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,430e73ffe1dca4e9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!e7g2000yqf.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: How to exit a loop with keyboard input Date: Fri, 16 Apr 2010 00:23:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9c893cc9-5ae6-434b-b893-1f139c893313@e7g2000yqf.googlegroups.com> 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> NNTP-Posting-Host: 75.172.180.11 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1271402598 2190 127.0.0.1 (16 Apr 2010 07:23:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 16 Apr 2010 07:23:18 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: e7g2000yqf.googlegroups.com; posting-host=75.172.180.11; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/528.16+(KHTML, like Gecko, Safari/528.16) OmniWeb/v622.8.0,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:10981 Date: 2010-04-16T00:23:17-07:00 List-Id: On Apr 15, 5:06=A0pm, BrianG wrote: > > Jerry > > When GNAT for DOS/Windows (yeah, a while ago - remember Ada9X?) did > this, I used a 'wimp out' solution: > > =A0 =A0 function KB_Hit return Boolean; > =A0 =A0 pragma Import(KB_Hit, "kbhit"); --not sure of the syntax > =A0 =A0 ... > =A0 =A0 =A0 =A0exit when KB_Hit; > =A0 =A0 ... > =A0 =A0(of course you have to remember to Flush or equiv) > > Not pretty, but it worked. > I would love to use this but it turns out that kbhit is a Windows thing and possibly a Borland thing. And I'm on OS X. Seems Unix/Linux doesn't have an equivalent which strikes me as odd. But I found an implementation for Linux here: http://www.pwilson.net/kbhit.html I might give it a whirl. Jerry Jerry > --BrianG > > =A0 =A0 =A0 =A0 --I'm in a groove now - > =A0 =A0 =A0 =A0 -- Or is it a rut?