comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Text input on a console
Date: 1997/04/26
Date: 1997-04-26T00:00:00+00:00	[thread overview]
Message-ID: <01bc524d$a0fe21a0$28f982c1@xhv46.dial.pipex.com> (raw)
In-Reply-To: E961o5.AuL@thomsoft.com




Keith Thompson <kst@sd.aonix.com> wrote in article
<E961o5.AuL@thomsoft.com>...
> In <01bc4d85$4c127b40$f4f582c1@xhv46.dial.pipex.com> "Nick Roberts"
<Nick.Roberts@dial.pipex.com> writes:
> > The answer is to use 
> > 
> >    Get_Line(Command);
> > 
> > instead of just
> > 
> >    get(command)
> > 
> > Reason why: things getting stuck in the buffer.
> 
> That's the problem, but it's not the solution.
> 
> In the previously posted program, Command is an object of an enumeration
> type.  There is no Get_Line procedure for enumeration types (though it
> wouldn't be difficult to write one).


I blunder again. Sorry (the little yellow tablets strike again).

However, this does raise another point, of more general interest. The
behaviour of a program when inputting text from a console is relatively
undefined in Ada (as in most languages). It may be impracticable to try to
formally define things more closely (i.e. in the RM), but it may be
sensible to informally define things a little bit more than the RM,
somehow.

When GET is used to read a string, or other type, from the console, should
the program wait for a carriage-return ('cooked' or 'buffered' mode) or
just get the characters directly ('raw' mode)? Should special characters
(like backspace, control-D, control-Z, ESC, etc.) be automatically
supported? Should there be some agreed parameters in the FORM parameter to
specify this sort of thing? (And, in which case, what do we do about
STANDARD_INPUT?)

Comments welcome.

Nick.





  reply	other threads:[~1997-04-26  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01bc49c1$c8c990a0$c47d8ea1@AaBbCcDd>
     [not found] ` <3355E2D9.243@aonix.com>
1997-04-17  0:00   ` Examine my code! Dale Stanbrough
1997-04-17  0:00   ` No! Gautier
1997-04-17  0:00     ` No! Oliver Kellogg
1997-04-20  0:00 ` Examine my code! Nick Roberts
1997-04-23  0:00   ` Centaury
1997-04-24  0:00   ` Keith Thompson
1997-04-26  0:00     ` Nick Roberts [this message]
1997-04-27  0:00       ` Text input on a console Jerry van Dijk
1997-04-29  0:00 ` Examine my code! Odo Wolbers
replies disabled

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