ASK
Format: ASK <prompt>
Template: PROMPT/A
Purpose: To obtain user input when executing a script file.
Path: Internal
Specification:
ASK is used in scripts to write the string specified by <prompt> to the
current window then wait for keyboard input. Valid keyboard responses are Y
(yes), N (no), and Return (no). If Y is pressed, ASK sets the condition flag
to 5 (WARN). If N or Return is pressed, the condition flag is set to 0. To
check the response, an IF statement can be used.
If the <prompt> contains spaces, it must be enclosed in quotation marks.
Example:
Assume a script contained the following commands:
ASK Continue?
IF WARN
ECHO Yes
ELSE
ECHO No
ENDIF
When the ASK command is reached, "Continue?" will appear on the screen. If
Y is pressed, Yes will be displayed on the screen. If N is pressed, No will
be displayed.
NB!
ASK is not case sensitive, so it doesn't matter if you press y
instead
of Y
in the example above.
See also:
IF
ELSE
ENDIF
Converted from AmigaGuide to HTML by Jaruzel