HAK Procedure

Standard Library procedure that lets you implement a “hit any key to
continue” function.

Usage

    HAK

Parameters

None.

Keywords

Mesg—Alerts the user that the procedure is momentarily stopped. If set to 1 (the default), the following message is printed on the display screen:

    Hit any key to continue...

Mesg may also be set to an arbitrary string.

Discussion

HAK waits for keyboard input, clears the typeahead buffer, and allows the application to continue. It is used primarily to stop a procedure momentarily—for example, to allow the user to read an explanation screen or view a temporary plot.

Example 1

a = INDGEN(100)
PLOT, a
HAK
; PV-WAVE halts execution until a key stroke,
; without printing a message
PLOT, a + 100

Example 2

t = 'When ready, press a key...'
HAK, Mesg=t
; PV-WAVE prints: When ready, press a key...
; and then waits for a key stroke 

See Also

WAIT