command-wait(2)command-wait - Conditional wait command
n command-wait
When a +ve argument n is given command-wait waits for n milliseconds before returning, this wait cannot be interrupted. If a -ve argument is given, command-wait waits for -n milliseconds but the command will return if the user interrupts with any input activity (i.e. presses a key).
When no argument is given command-wait loops getting and processing events (user input, screen updates etc) until either the calling commands .wait command variable is undefined or set to false (0). This more complex use of the command is used when a main macro must wait and process input until an exit criteria has been met, the input is best processed by setting the $buffer-input(5) variable to a second macro. The macro gdiff(3) uses this command in this way.
The following macro code will display a message on the screen for a fixed 5 seconds:
16 screen-poke 10 10 0 "Hello World!" 5000 command-wait
Similarly the following macro code will display a message for up to 5 seconds or till the user presses a key:
16 screen-poke 10 10 0 "Hello World!" -5000 command-wait
(c) Copyright JASSPA 2002
Last Modified: 2001/12/18
Generated On: 2002/01/06