From: Jeff Carter <spam.carter.not@spam.innocon.com>
Subject: Re: How to get a character?
Date: 1999/04/12
Date: 1999-04-12T00:00:00+00:00 [thread overview]
Message-ID: <3711753C.A665E406@spam.innocon.com> (raw)
In-Reply-To: E5joh01g#GA.220@pet.hiwaay.net
Again, I see people recommending Ada.Text_Io.Get_Line as the way to
perform the "Press Enter [or Return] to continue:" function. This is
incorrect. When, in response to this message, the user types enough
characters to fill the Item parameter to Get_Line, the program will
continue before the user presses Enter [or Return]. If the user
mistakenly types ahead, this can be a significant problem.
In Ada terms, the desired behavior is for the program to wait until the
user inputs a line terminator on standard input, and consume that line
terminator. The Enter [or Return] key is how the user inputs a line
terminator. The correct way to wait for and consume a line terminator on
standard input is
Ada.Text_Io.Skip_Line;
--
Jeff Carter
"You empty-headed animal-food-trough wiper."
Monty Python & the Holy Grail
next prev parent reply other threads:[~1999-04-12 0:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-10 0:00 How to get a character? Ben Barth
1999-04-10 0:00 ` David C. Hoos, Sr.
1999-04-12 0:00 ` Jeff Carter [this message]
1999-04-12 0:00 ` Larry Kilgallen
1999-04-12 0:00 ` Robert Dewar
1999-04-10 0:00 ` Matthew Heaney
1999-04-10 0:00 ` bglbv
1999-04-10 0:00 ` Matthew Heaney
1999-04-12 0:00 ` Fraser Wilson
1999-04-13 0:00 ` Get_Immediate warning, (was: How to get a character?) JS
1999-04-13 0:00 ` Robert Dewar
1999-04-13 0:00 ` bglbv
1999-04-14 0:00 ` Larry Kilgallen
1999-04-14 0:00 ` Robert Dewar
1999-04-14 0:00 ` bglbv
1999-04-15 0:00 ` Robert Dewar
1999-04-16 0:00 ` Matthew Heaney
1999-04-16 0:00 ` Robert Dewar
1999-04-18 0:00 ` Jean-Pierre Rosen
1999-04-19 0:00 ` Robert A Duff
1999-04-14 0:00 ` JS
1999-04-14 0:00 ` Robert Dewar
1999-04-19 0:00 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox