comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <matthew_heaney@acm.org>
Subject: Re: Keyboard input time out routine
Date: 1999/11/11
Date: 1999-11-11T00:00:00+00:00	[thread overview]
Message-ID: <382ac169_3@news1.prserv.net> (raw)
In-Reply-To: 11FADB0F359D6AC2.1F52588FCDAC2F80.5B1126BE5AE8CD31@lp.airnews. net

In article 
<11FADB0F359D6AC2.1F52588FCDAC2F80.5B1126BE5AE8CD31@lp.airnews.net> ,
Ray <crwhite12@airmail7.net>  wrote:

> I am trying to allow a max time for keyboard (math speed test program),
> but the following code only sort of works.  It times out, but waits for
> an input (unused) before printing out the message.  I want the message
> to print as soon as the time allotted for input has passed.  Hints? Is
> select even the right way to go (pulled the code from the help docs)?

I don't think your ATC example will work.  You could try polling the
input using Get_Immediate:

declare
  C : Character;
  Available : Boolean;
begin
  for I in 1 .. 50 loop
    Get_Immediate (C, Available);
    exit when Available;
    delay 0.1;
  end loop;

  if Available then
    <do whatever>
  else
    Put_Line ("No data entered.");
  end if;
end;


--
Science is, foremost, a method of interrogating reality: proposing
hypotheses that seem true and then testing them -- trying, almost
perversely, to negate them, elevating only the handful that survive to
the status of a theory. Creationism is a doctrine, whose adherents are
interested only in seeking out data that support it.

George Johnson, NY Times, 15 Aug 1999




       reply	other threads:[~1999-11-11  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11FADB0F359D6AC2.1F52588FCDAC2F80.5B1126BE5AE8CD31@lp.airnews. net>
1999-11-11  0:00 ` Matthew Heaney [this message]
1999-11-11  0:00   ` Keyboard input time out routine Ray
1999-11-11  0:00     ` Matthew Heaney
1999-11-11  0:00       ` Ray
1999-11-11  0:00         ` David C. Hoos, Sr.
1999-11-09  0:00 Ray
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox