Previous Topic: start-java Command--Start Java Virtual Machine (Cmdlet)Next Topic: weak external Command--Declare Native External Function (Cmdlet)


wait Command--Wait for a Key Press (Cmdlet)

This command comes in the following versions:

The command has the following syntax:

wait [prompt] to var
wait [prompt] 
prompt

(Optional) String to be displayed as input prompt. If no prompt is specified, the command automatically displays "Press any key...". To display no prompt, pass an empty string (""). Unquoted argument tokens are automatically stringified. Prevent automatic quoting for expressions by placing expression code in parentheses.

var

Name of variable to assign the pressed key character to.

Examples

Wait for a key press and display a custom prompt message:

do
{
    wait "Enter a number between 1 and 5:" to x
    x = parseInt(x);
}
while(x<1 || x>5)

See also:

accept Command--Read String From stdin and Assign it to a Variable (Cmdlet)