Command WAIT Foundation

Waits for a keystroke or until a character appears in the keyboard buffer.

Syntax
WAIT [<SayExpression>] [TO <VarName>]
Parameters
<SayExpression>
<SayExpression> can be optionally specified. The expression can be a value of data type character, numeric, date or logical. This expression is displayed prior to waiting for the keypress. If this argument is not included, a default message is displayed which depends on the country specific version of Xbase++.
<VarName>
<VarName> specifies the variable into which the input character is placed. If the variable is not declared, a PRIVATE variable with this name is created.
Description

The command WAIT allows input of a single character via the keyboard and assigns the character to a variable. It is a simple input routine which first outputs the control characters Carriage-Return Line-Feed (Chr(13)+Chr(10)) so that the cursor appears at the beginning of the next screen row. <SayExpression> is then displayed and the command waits for a keypress or reads the next character from the keyboard buffer.

WAIT is a command which exists only for compatibility reasons. Instead of WAIT, a pause condition using Inkey(0) should be created. The key pressed can then be retrieved using LastKey(). The command @...SAY can be used for output of the message.

Examples
WAIT
// The example shows various ways to call the 
// command WAIT. 

PROCEDURE Main 
   LOCAL cKey 

   WAIT "Press key..." TO cKey 
   WAIT ""             TO cKey 

   WAIT 12345          TO cKey 

   WAIT Date()         TO cKey 

   WAIT .T.            TO cKey 

   WAIT TO cKey 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.