From: Manuel Collado <m.collado@domain.invalid>
Subject: Re: How to exit a loop with keyboard input
Date: Mon, 12 Apr 2010 11:21:14 +0200
Date: 2010-04-12T11:21:14+02:00 [thread overview]
Message-ID: <hpuomb$ass$1@heraldo.rediris.es> (raw)
In-Reply-To: <4bc2debb$0$6763$9b4e6d93@newsspool3.arcor-online.net>
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
next prev parent reply other threads:[~2010-04-12 9:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 4:12 How to exit a loop with keyboard input Jerry
2010-04-12 8:50 ` Georg Bauhaus
2010-04-12 9:21 ` Manuel Collado [this message]
2010-04-12 10:36 ` Jerry
2010-04-12 13:59 ` John McCormick
2010-04-13 19:38 ` Jerry
2010-04-12 15:14 ` Tero Koskinen
2010-04-12 16:16 ` John B. Matthews
2010-04-12 20:04 ` Simon Wright
2010-04-13 19:51 ` Jerry
2010-04-13 21:22 ` Simon Wright
2010-04-15 3:39 ` Jerry
2010-04-15 4:08 ` John B. Matthews
2010-04-15 18:51 ` Jerry
2010-04-16 0:44 ` John B. Matthews
2010-04-16 4:43 ` Simon Wright
2010-04-16 14:03 ` John B. Matthews
2010-04-15 19:22 ` Simon Wright
2010-04-16 10:25 ` Jerry
2010-04-12 20:57 ` Alex Mentis
2010-04-12 22:51 ` Jerry
2010-04-16 0:06 ` BrianG
2010-04-16 7:23 ` Jerry
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox