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=0.1 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,463c997594f91391 X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: How to get a character? Date: 1999/04/12 Message-ID: <3711753C.A665E406@spam.innocon.com>#1/1 X-Deja-AN: 465342524 Content-Transfer-Encoding: 7bit References: <370EE07D.67C71458@dave-world.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Verio Mid-Atlantic Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-04-12T00:00:00+00:00 List-Id: 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