- Form: ASK ['An optional prompt in quotes'] var_name [DEFAULT=def]
-
This command can be used to request the input of variable values during the
execution of a procedure. When the ASK command is executed, the prompt
will be displayed at the terminal until the requested value is typed in.
If no prompt is given, the command will respond with 'ENTER var_name:'.
Only one value can be requested per ASK command. If you specify a default
value using DEFAULT=def, then this value will be assigned to the variable
if the user enters a carriage return at the prompt.
Examples:
- ASK BCKGND
- will print 'ENTER BCKGND : on your screen. When
you enter an expression and hit RETURN, the value of BCKGND will be
set to the number you specified.
- ASK 'Enter an estimate for the background
' BCKGND
- will type the prompt 'Enter an estimate for the background
' on
your terminal, and wait for you to enter an expression; the value of
BCKGND is the value of that expression.
- ASK 'Enter your favorite number: ' FAVORITE DEFAULT=7
- will type the prompt 'Enter you favorite number: ' and wait for
you to enter an expression; if you hit a single carriage return, the
value 7 will be assigned to the variable FAVORITE.
Note that the reply to ASK can be any valid expression.