ASK (get one keystroke)

Top  Previous  Next

 

ASK

ASK reads a single keystroke from the keyboard buffer. Program execution stops to wait for a keystroke. If there is already a keystroke in the keyboard buffer, ASK gets one keystroke without waiting. The ASK statement also allows any TIMER attribute events to generate and cycle their own ACCEPT loop. This means any batch processing code can allow other threads to execute their TIMER attribute tasks during the batch process.

Example:

ASK                   !Wait for a keystroke

LOOP WHILE KEYBOARD() !Empty the keyboard buffer

ASK                  !without processing keystrokes

END

 

See Also:

KEYCODE

KEYBOARD