Here's my hastily hacked together solution, it allows 5 seconds for the
user to enter a string. It grabs a single character at a time and builds
up a string - you need to cater for special characters manually, I've
coded for enter and backspace, you could just discard any others that
are below CHAR(32) or above CHAR(126). It doesn't display anything on
screen - you could add CRT statements as the string is built up.
CT = 0
LOOP
LOOP
INPUT CHAR.WAITING,-1
WHILE CHAR.WAITING
CHARACTER = KEYIN()
BEGIN CASE
CASE CHARACTER = CHAR(10) ;* Enter
CT = 100
EXIT
CASE CHARACTER = CHAR(8) ;* Backspace
IF LEN(THE.STRING)
THEN THE.STRING = THE.STRING[1,LEN(THE.STRING)-1]
CASE @TRUE
THE.STRING := CHARACTER
END CASE
REPEAT
NAP 50
WHILE CT < 100
CT += 1
REPEAT
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Norman, David
(Health)
Sent: Friday, 13 March 2009 9:38 AM
To: [email protected]
Subject: Re: [U2] UV Timed INPUT
Thanks to all for the responses; yes the UniData INPUT ... WAITING looks
like it would be great but it doesn't exist on UniVerse.
I'm still battling with the basic problem of trying to intercept a
partially entered string after a certain time. If typing has started but
Enter hasn't been pressed to finalise an INPUT command, then everything
waits until the INPUT is satisfied. I need to jump in after (say) 5
seconds of waiting for ENTER and abandon the INPUT.
INPUTIF is part of the solution, but it also waits for an ENTER which
may never arrive.
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/
DISCLAIMER:
Disclaimer. This e-mail is private and confidential. If you are not the
intended recipient, please advise us by return e-mail immediately, and delete
the e-mail and any attachments without using or disclosing the contents in any
way. The views expressed in this e-mail are those of the author, and do not
represent those of this company unless this is clearly indicated. You should
scan this e-mail and any attachments for viruses. This company accepts no
liability for any direct or indirect damage or loss resulting from the use of
any attachments to this e-mail.
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/