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=-1.3 required=5.0 tests=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: "David C. Hoos, Sr." Subject: Re: How to get a character? Date: 1999/04/10 Message-ID: #1/1 X-Deja-AN: 464797094 Content-Transfer-Encoding: 7bit References: <370EE07D.67C71458@dave-world.net> Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-04-10T00:00:00+00:00 List-Id: Ben Barth wrote in message <370EE07D.67C71458@dave-world.net>... >I was wondering if there was a way to get a character in Ada from the >user such as the getchar() function that can be used in C. I'm trying >to add a stop after displaying some information to the screen so the >user can press any key to continue with the program. I used the >Text_IO.Get() function but that didn't seem to work very well. > If you really want him to just press any key, and only one key, then in Ada95, you can use text_io.Get_immediate -- the one with only one parameter. This procedure will not return until the user types some (any) character. If using Ada83, then, without resorting to some OS-specific or compiler-specific code, you would use text_io.Get_Line. However, this will require a character to return from the call. You could, of course simply say "Press return to Continue." >I was also wondering if there was a way to format output to the screen >ala C which uses "\t" for a tab. > This one's the same in Ada83 and Ada95: If I wanted to move to the next "tab stop" where the "stops" are at intervals of N columns, I would do Ada.Text_IO.Set_Col (((Ada.Text_IO.Col + N) mod N) + 1); (of course leave off the Ada. prefix if using Ada83).