We use the waiting or...
Sample code:
147:        WAIT.TIME = 0
148:        LOOP
149:         IF SYSTEM(10) OR SYSTEM(14) THEN
150:           INPUT RTN.VAL,31999 _ ELSE RTN.VAL=""; TIMEOUT=1
151:           WAIT.TIME=REFRESH+1
152:         END ELSE
153:           RTN.VAL=""
154:           SLEEP 1
155:           WAIT.TIME=WAIT.TIME+1
156:         END
157:       UNTIL WAIT.TIME >= REFRESH DO
158:       REPEAT
159:       IF RTN.VAL = "" THEN TIMEOUT=1

Nicholas M Gettino | Director of Development | EnRoute Emergency
Systems, an Infor company | office: 813-207-6998 | fax: 678-393-5389
nick.gett...@infor.com | www.enroute911.com
-----Original Message-----
From: owner-u2-us...@listserver.u2ug.org
[mailto:owner-u2-us...@listserver.u2ug.org] On Behalf Of Brian Leach
Sent: Thursday, March 12, 2009 5:46 AM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] UV Timed INPUT

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
* norman.da...@saambulance.com.au

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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to