comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: please help me!!!!!!
Date: Thu, 18 Oct 2001 17:59:07 GMT
Date: 2001-10-18T17:59:07+00:00	[thread overview]
Message-ID: <3BCF186B.3AE5FD70@boeing.com> (raw)
In-Reply-To: 3BCF12A4.43DC6207@boeing.com

Jeffrey Carter wrote:
> 
> 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.

I seemed to have tripped over my tongue while typing this. This code
raises Constraint_Error if the line is longer than S; Get_Line never
raises Constraint_Error. This code never skips the line terminator;
Get_Line skips the line terminator if the line is shorter than S.

-- 
Jeffrey Carter



      reply	other threads:[~2001-10-18 17:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-18  7:33 please help me!!!!!! F
2001-10-18 11:04 ` John McCabe
2001-10-18 13:04 ` F
2001-10-18 17:34 ` Jeffrey Carter
2001-10-18 17:59   ` Jeffrey Carter [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox