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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,430e73ffe1dca4e9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!188.40.43.213.MISMATCH!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: BrianG Newsgroups: comp.lang.ada Subject: Re: How to exit a loop with keyboard input Date: Thu, 15 Apr 2010 20:06:47 -0400 Organization: A noiseless patient Spider Message-ID: References: <176f2831-ce2a-4bb1-9e04-47f662fc7176@q23g2000yqd.googlegroups.com> <1ae9ff84-2a28-41a2-9669-f88577020037@q23g2000yqd.googlegroups.com> <8df458e5-3310-4c9b-adef-638908401626@r18g2000yqd.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 16 Apr 2010 00:06:27 +0000 (UTC) Injection-Info: feeder.eternal-september.org; posting-host="yhQWPMeVRpVpuDNdNP0zCg"; logging-data="16336"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/SIGlkvYIMrTSsz207PTZN" User-Agent: Thunderbird 2.0.0.24 (X11/20100317) In-Reply-To: <8df458e5-3310-4c9b-adef-638908401626@r18g2000yqd.googlegroups.com> Cancel-Lock: sha1:pJhhP0DE1PTe7kXMZ73a6Kh4yLY= Xref: g2news2.google.com comp.lang.ada:10973 Date: 2010-04-15T20:06:47-04:00 List-Id: Jerry wrote: > On Apr 12, 1:57 pm, Alex Mentis wrote: > snip >> Are you using GPS as your IDE by any chance? When I run programs >> using Get_Immediate from inside GPS, Get_Immediate does not work as it >> should (it requires a CR after the character input). When I run those >> same programs in an external terminal window it works fine. Perhaps >> something between your keyboard and your program is buffering your >> input without your knowledge? >> >> Alex > > I'm not using GPS, but I thought of the possibility of a problem with > the development environment which in my case is Apple's Xcode. That's > why I executed in three other terminal programs (including Apple's > Terminal.app, the terminal in Path Finder, and something called > iTerm), but all gave the same result. Which doesn't completely answer > the question of stealth buffering. But given the discussion above > about a patch I'm guessing the problem is not weird buffering. > > Jerry When GNAT for DOS/Windows (yeah, a while ago - remember Ada9X?) did this, I used a 'wimp out' solution: function KB_Hit return Boolean; pragma Import(KB_Hit, "kbhit"); --not sure of the syntax ... exit when KB_Hit; ... (of course you have to remember to Flush or equiv) Not pretty, but it worked. --BrianG --I'm in a groove now - -- Or is it a rut?