From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: How to exit a loop with keyboard input
Date: Mon, 12 Apr 2010 10:50:03 +0200
Date: 2010-04-12T10:50:04+02:00 [thread overview]
Message-ID: <4bc2debb$0$6763$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <176f2831-ce2a-4bb1-9e04-47f662fc7176@q23g2000yqd.googlegroups.com>
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.
next prev parent reply other threads:[~2010-04-12 8:50 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 [this message]
2010-04-12 9:21 ` Manuel Collado
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