Timed response


bobsmail@...
 

I know I should be able to find it but I am at a loss. Example :

INPUT " 2 * 2 = ",

No problem if one enters 4 or any other number  BUT


How do II get the program to proceed if there is NO response after a WAIT 300 for example.


andy@...
 

If you use INKEY you can specify a wait time. Like GET, it returns one keypress so you'd need some extra code to cope with multi digit or signed input. 


J.G.Harston
 

On 02-06-2021 02:02, andy@hopkinsway.net wrote:
If you use INKEY you can specify a wait time. Like GET, it returns one
keypress so you'd need some extra code to cope with multi digit or
signed input.
Yep. Don't use INPUT. INPUT (essentially) uses GET which waits for
the user, forever if neccessary. Use your own code that only waits
for as long as you want it to wait for. Thrown together:

A$=""
REPEAT
A%=INKEY(300)
IF A%>31 THEN IF A%<127 THEN A$=A$+CHR$A%:VDU A%
IF A%=127 THEN IF A$<>"" THEN A$=LEFT$(A$,LENA$-1):VDU 127
UNTIL A%=13 OR A%=-1
IF A%=-1 THEN timed out

--
J.G.Harston - jgh@mdfs.net - mdfs.net/jgh


bobsmail@...
 

Thanks for your replies.  I thought things might be somewhat simpler.  I can see that for a response requiring several mdigits it could get problematic.

Bob Horton