xHarbour Reference Documentation > Command Reference |
Suspend program execution until a key is pressed.
WAIT [<msgVar>] [TO <varName>]
WAIT is a simple console input command that employs a wait state until the user presses a key. The command displays a message on the screen in a new line. The message can be suppressed by passing a null string ("") for <msgExpr>.
The key pressed by the user can be assigned as character value to a variable for further processing.
Note: WAIT is a compatibility command that should be replaced with function Inkey().
See also: | @...GET, ACCEPT, Inkey(), INPUT, MENU TO |
Category: | Input commands |
Source: | rtl\wait.prg |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example shows how to query for a single key stroke. PROCEDURE Main ? "Program started..." ? WAIT "Press Q to QUIT, any other key to continue" TO cKey IF cKey $ "qQ" ? "Program aborted" QUIT ENDIF ? "Normal program termination". RETURN
http://www.xHarbour.com