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: a07f3367d7,430e73ffe1dca4e9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!feeder.erje.net!newsfeed.velia.net!news.tu-darmstadt.de!news.belwue.de!kanaga.switch.ch!switch.ch!news.rediris.es!not-for-mail From: Manuel Collado Newsgroups: comp.lang.ada Subject: Re: How to exit a loop with keyboard input Date: Mon, 12 Apr 2010 11:21:14 +0200 Organization: RedIRIS Message-ID: References: <176f2831-ce2a-4bb1-9e04-47f662fc7176@q23g2000yqd.googlegroups.com> <4bc2debb$0$6763$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: acedia.ls.fi.upm.es Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: heraldo.rediris.es 1271064075 11164 138.100.10.20 (12 Apr 2010 09:21:15 GMT) X-Complaints-To: jesus.heras@rediris.es NNTP-Posting-Date: Mon, 12 Apr 2010 09:21:15 +0000 (UTC) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <4bc2debb$0$6763$9b4e6d93@newsspool3.arcor-online.net> Xref: g2news1.google.com comp.lang.ada:9960 Date: 2010-04-12T11:21:14+02:00 List-Id: Georg Bauhaus escribi�: > Jerry schrieb: > >> with Ada.Text_IO; >> use Ada.Text_IO; >> procedure key is >> i : Integer; >> Keystroke : Character; >> Available : Boolean; >> begin >> i := 0; >> loop >> Put(Integer'Image(i)); >> Get_Immediate(Keystroke, Available); >> if Available then >> if Keystroke = 'q' then >> exit; >> end if; >> end if; >> i := i + 1; >> end loop; >> Put_Line("Finished"); >> end key; > > > Works as desired on Debian GNU/Linux stable. Also in Windows XP with GNAT GPL 2005 -- Manuel Collado - http://lml.ls.fi.upm.es/~mcollado