David

try the following:

FUNCTION TimedInput(Period, Value)

$OPTIONS PICK

Now = Time()
Loop
  Input n,-1
Until n Or ((Time() - Now) > Period) Do
  Nap 50
Repeat
If Not(n) Then
  Result = @False
End Else
  Input Value
  Result = @True
End
RETURN(Result)

as in:

PROGRAM TestInput

$OPTIONS PICK

DEFFUN TimedInput( Period, Value)

If TimedInput(3, Test) Then
   Crt "test is ":Test
End Else
   Crt "No input"
End


Brian




I'm sure I've seen something about this recently, but I've searched the
past 2 years with no luck. I want to do a timed INPUT in UV - if after n
seconds the Enter key hasn't been pressed, do something.
Anyone got any clever ways of doing this ?

Thanks,
========================
David Norman
Senior Software Engineer - SA Ambulance Service

ICT Services
SA Health
Government of South Australia

Box 3, GPO
Adelaide, South Australia 5001
*+61 8 8274 0384
* fax +61 8 8271 4844
* [email protected]

This e-mail may contain confidential information, which also may be
legally privileged. Only the intended recipient(s) may access, use,
distribute or copy this e-mail. If this e-mail is received in error,
please inform the sender by return e-mail and delete the original. If
there are doubts about the validity of this message, please contact the
sender by telephone. It is the recipient's responsibility to check the
e-mail and any attached files for viruses.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to