comp.lang.ada
 help / color / mirror / Atom feed
From: jerry@jvdsys.nextjk.stuyts.nl (Jerry van Dijk)
Subject: Re: Text input on a console
Date: 1997/04/27
Date: 1997-04-27T00:00:00+00:00	[thread overview]
Message-ID: <862121330.22snx@jvdsys.nextjk.stuyts.nl> (raw)
In-Reply-To: 01bc524d$a0fe21a0$28f982c1@xhv46.dial.pipex.com


In article <01bc524d$a0fe21a0$28f982c1@xhv46.dial.pipex.com> Nick.Roberts@dial.pipex.com writes:

>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.

"Define informally" ?

Although I sympathize with the idea, how would one go about this ?

>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)?

Like Get vs Get_Immediate ?

The problem is of course how to go about it in a portable way as this is
purely OS dependend.

>Should special characters
>(like backspace, control-D, control-Z, ESC, etc.) be automatically
>supported?

As these are part of Latin-1 that shouldn't be much of a problem, but
how about Ctrl-Home or Gold-F1 ? Or are you talking about the Line Editing
features of the OS ?

> 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?)

One solution might be the way C compilers for DOS solved it: using a special
Console I/O (conio) package. This could be in a special Annex, applicable
only to platforms that support terminal based or interactive I/O.

Since the IS Annex comes close to this, I wonder if such a package
(which would do wonders for the portability of console apps) has been
considered.

A good candidate would be a binding to termios, if it were supported
on all platforms (GNAT doesn't, it even can't agree on the implementation
of Get_Immediate between different ports...)

>Comments welcome.

You asked for it :-)

--

-- Jerry van Dijk       | Leiden, Holland
-- Business Consultant  | Team Ada
-- Ordina Finance       | jdijk@acm.org




  reply	other threads:[~1997-04-27  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     ` Text input on a console Nick Roberts
1997-04-27  0:00       ` Jerry van Dijk [this message]
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