next up previous index
Next: Using Variables to Specify Up: Variables, Arithmetic Expressions, & Previous: TYPE: Evaluate/Print Arithmetic Expressions   Index

ASK: Prompt for Numerical Input at the Keyboard


\begin{command}
\item[\textbf{Form: } ASK {['An optional prompt in quotes']} var\_name {[DEFAULT=def]}\hfill]{}
\end{command}

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:
\begin{example}
\item[ASK BCKGND\hfill]{will print 'ENTER BCKGND : on your scre...
...turn, the
value 7 will be assigned to the variable FAVORITE.}
\par\end{example}

Note that the reply to ASK can be any valid expression.



Jon Holtzman 2002-02-13