Understanding the INPUT instruction

The INPUT instruction controls a single record input from form fields.

The INPUT statement binds program variables to screen-records for data entry in form fields. The INPUT statement uses the current form in the current window. Before executing the INPUT statement, record data must be fetched from the database table into the program variables using the input statement.

An INPUT will start with empty fields, unless the WITHOUT DEFAULTS option is used. Using WITHOUT DEFAULTS clause instructs the INPUT dialog to use the current data of the program variables/record bound to the dialog.

During the INPUT statement execution, the user can edit the record fields, while the program controls the behavior of the instruction with control blocks.

When the user moves from field to field or changes values, dialog control blocks such as BEFORE FIELD are executed.

When the user clicks on an action view (button), or when an asynchronous event occurs, dialog interaction blocks like ON ACTION are executed.

The code inside an INPUT dialog can use control instructions, dialog control functions, and the ui.Dialog class, to implement the dialog behavior.

To terminate the INPUT execution, the user can validate (or cancel) the dialog to commit (or invalidate) the modifications made in the record.

When the statement completes execution, the form is deactivated. After the user terminates the input (for example, with the "accept" key), the program must test the int_flag variable to check if the dialog was validated (or canceled), and then can use the INSERT or UPDATE SQL statements to modify the appropriate database tables.