Understanding the INPUT instruction

The INPUT statement binds program variables to screen-records in forms 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 by the input statement.


INPUT instruction diagram

Figure 1. INPUT instruction

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

INPUT instruction control blocks diagram

Figure 2. INPUT instruction with control blocks

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

INPUT instruction commit or cancellation diagram

Figure 3. INPUT instruction commit or cancellation

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.