accept

Syntax

accept variable [NUM[BER] | CHAR | BINARY_FLOAT | BINARY_DOUBLE] [DEF[AULT] default] [PROMPT text|NOPR[OMPT]] [HIDE]

Description

Gets input from a user and DEFINES the variable. If a type is specified then it validates for that type. The default (enclosed in quotes) is assigned if the user just presses enter. The prompt is displayed before waiting for input (or can be suppressed). The HIDE option stops the terminal from displaying the entered text (for passwords).

The prompt is displayed before waiting for input, if specified without the HIDE option.

Examples

To display the prompt Password:, place the reply in a CHAR variable named PSWD, and suppress the display, enter:

accept pswd CHAR PROMPT 'Password:  ' HIDE

To display the prompt Enter weekly salary: and place the reply in a NUMBER variable named SALARY with a default of 000.0, enter:

accept salary NUMBER FORMAT '999.99' DEFAULT '000.0' -
PROMPT 'Enter weekly salary:  '

To display the prompt Enter employee lastname: and place the reply in a CHAR variable named LASTNAME, enter:

accept lastname CHAR FORMAT 'A20' -
PROMPT 'Enter employee lastname:  '