Understanding the PROMPT instruction
The PROMPT
instruction is used to query for a single value from the
user.
PROMPT
requires the text of the question to be
displayed to the user and the variable that receives the value entered
by the user. The variable can be of any simple data type except
TEXT
and BYTE
.
The runtime system displays the question in the prompt area, waits for the user to enter a value, reads whatever value was entered until the user validates (for example with the Enter key), and stores this value in a response variable. The prompt dialog remains visible until the user enters a response.
The prompt finishes after ON IDLE
, ON ACTION
, or
ON KEY
block execution (to ensure backward compatibility).
PROMPT
dialog is automatically terminated after ON
IDLE
, ON TIMER
,
ON ACTION
, or ON KEY
block execution.Prompt display in TUI mode
PROMPT
question and input field is displayed in the prompt line
of the current window, which is defined by the OPTIONS PROMPT LINE
instruction or
with the ATTRIBUTES
clause of OPEN WINDOW
.Prompt display in GUI mode
In GUI mode, the PROMPT
instruction opens a modal
window with an OK and a Cancel button, and waits for input from the user.