From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,26f4415626696f47 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-18 10:53:24 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-hub.siol.net!zur.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: please help me!!!!!! X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3BCF12A4.43DC6207@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <9qm0di$25sj$1@newsreader1.mclink.it> Mime-Version: 1.0 Date: Thu, 18 Oct 2001 17:34:28 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:14902 Date: 2001-10-18T17:34:28+00:00 List-Id: You might want to consider using a somewhat more meaningful subject. When I see something like this, my thoughts are something like: Somebody who calls himself F has posted a message with the subject "please help me!!!!!!". Help is needed on what? Is it something I can help with? Do I want to read the message and perhaps waste my time finding out it's something I'm not interested in? F wrote: > > I want to "clean" the keyboard buffer after a user action, for example i > have a piece of a procedure such as > ... > c:character; s:string(1..20); ind:integer:=1; > ... > while not end_of_line loop > get(c); > s(i):=c; > i:=i+1; > end loop; It's hard to tell, since Ind is never referenced and I is undefined. However, if I is supposed to be Ind, what you're doing is writing Ada.Text_IO.Get_Line, except you raise Constraint_Error if the line is as long as or longer than S, and you don't skip the line terminator if it isn't. The easy way to do this is Get_Line (Item => S, Last => Ind); After this call, S (S'First .. Ind) contains the characters read. If Ind = S'Last, then the line terminator was not skipped. -- Jeffrey Carter