The following steps describe how to use the INPUT statement:
Create a form specification file, with an optional screen
record. The screen record identifies the presentation elements
to be used by the runtime system to display the records. if you
omit the declaration of the screen record in the form file, the
runtime system will use the default screen records created by the
form compiler for each table listed in the TABLES section
and for the FORMONLY pseudo-table.
Make sure that the program controls interruption handling
with DEFER INTERRUPT, to manage the validation/cancellation
of the interactive dialog.
Define a program record with the DEFINE instruction.
The members of the program record must correspond to the elements
of the screen record, by number and data types.
Open and display the form, using an OPEN WINDOW with
the WITH FORM clause or the OPEN FORM / DISPLAY
FORM instructions.
If needed, fill the program record with data, for example
with a result set cursor.
Set the INT_FLAG variable to FALSE.
Write the INPUT statement to handle data
input.
Inside the INPUT statement, control the
behavior of the instruction with BEFORE INPUT, BEFORE
FIELD, AFTER FIELD, AFTER
INPUT and ON ACTION blocks.
After the interaction statement block, test the INT_FLAG predefined
variable to check if the dialog was canceled (INT_FLAG=TRUE)
or validated (INT_FLAG=FALSE). If
the INT_FLAG variable is TRUE, you
should reset it to FALSE to not disturb code
that relies on this variable to detect interruption events from
the GUI front-end or TUI console.