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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5cd788f18b560297 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!k36g2000pri.googlegroups.com!not-for-mail From: f.tolkamp@chello.nl Newsgroups: comp.lang.ada Subject: Re: How to get a key from keyboard Date: Mon, 22 Dec 2008 08:22:51 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <49301282$1_1@news.bluewin.ch> NNTP-Posting-Host: 77.249.221.108 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1229962974 2844 127.0.0.1 (22 Dec 2008 16:22:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 22 Dec 2008 16:22:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k36g2000pri.googlegroups.com; posting-host=77.249.221.108; posting-account=CRTuqQoAAACkAj4MrK0vtmdX5EEtJNCk User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.1),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3070 Date: 2008-12-22T08:22:51-08:00 List-Id: On 1 dec, 08:28, christoph.gr...@eurocopter.com wrote: > A.10.7 > =A0(9) procedure Get_Immediate(File : in File_Type; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Item : out Charac= ter); > =A0 =A0 =A0procedure Get_Immediate(Item : out Character); > > (10) Reads the next character, either control or graphic, from the > specified File or the default input file. Mode_Error is propagated if > the mode of the file is not In_File. End_Error is propagated if at the > end of the file. The current column, line and page numbers for the > file are not affected. > > (11) procedure Get_Immediate(File : in File_Type; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Item : out Cha= racter; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Available : ou= t Boolean); > =A0 =A0 =A0procedure Get_Immediate(Item : out Character; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Available : ou= t Boolean); > > (12) If a character, either control or graphic, is available from the > specified File or the default input file, then the character is read; > Available is True and Item contains the value of this character. If a > character is not available, then Available is False and the value of > Item is not specified. Mode_Error is propagated if the mode of the > file is not In_File. End_Error is propagated if at the end of the > file. The current column, line and page numbers for the file are not > affected. > > Thus the former procedures block if there is no character available, > the latter ones don't. > > Try: > > =A0 loop > =A0 =A0 get_immediate (C); > =A0 =A0 Put (Integer'Image (Character'Pos (c))); > =A0 end loop; > > Which compiler do you use? If you run the above within GPS, you must > press - otherwise GPS obviously does not forward the input to > the executable (note that GPS echoes the input and you can edit the > input line with ). If you run it from a terminal window, > you can press any key and immediately get the result (for some keys, > you'll get more than one number) and there is no echo of your input > and no editing. Indeed I run the program within GPS, so the enter key have to be pressed. How can I run the program from a terminal window?