Syntax of PROMPT instruction
The PROMPT
statement assigns a user-supplied
value to a variable.
Syntax
PROMPT question
[
{
ATTRIBUTE|
ATTRIBUTES}
( display-attribute [
,...]
) ]
FOR [
CHAR[
ACTER]]
variable
[
HELP number ]
[
{
ATTRIBUTE|
ATTRIBUTES}
( control-attribute [
,...]
) ]
[
dialog-control-block
[...]
END PROMPT ]
where dialog-control-block is one
of:
{
ON IDLE seconds
|
ON TIMER seconds
|
ON ACTION action-name
|
ON KEY ( key-name [
,...]
)
}
statement
[...]
where display-attribute is:
{
BLACK |
BLUE |
CYAN |
GREEN
|
MAGENTA |
RED |
WHITE |
YELLOW
|
BOLD |
DIM |
INVISIBLE |
NORMAL
|
REVERSE |
BLINK |
UNDERLINE
}
where control-attribute is:
{
ACCEPT [
= boolean ]
|
CANCEL [
= boolean ]
|
CENTURY = "century-spec"
|
FORMAT = "format-spec"
|
PICTURE = "picture-spec"
|
SHIFT = {
"up" |
"down" }
|
HELP = help-number
|
UNBUFFERED [
= boolean ]
|
WITHOUT DEFAULTS [
= boolean ]
}
- question is a string expression displayed as a message for the input of the value.
- variable is the name of the variable that receives the data typed by the user.
- The
FOR CHAR
clause exits the prompt statement when the first character has been typed. - number is the help message number to be displayed when the user presses the help key.
- key-name is an hot-key identifier (such as
F11
orControl-z
). - action-name identifies an action that can be executed by the user.
- seconds is an integer literal or variable that defines a number of seconds.
- statement is an instruction that is executed when the user presses the key defined by key-name.
- century-spec is a string specifying the century
input rule, like the
CENTURY
attribute. - format-spec is a string defining the display
format for the prompt field, like the
FORMAT
attribute. - picture-spec is a string defining the input format for the prompt field, like
the
PICTURE
attribute.