Program Flow for Online Programs

The following diagram shows the program flow for the procedure division of an online program. The flow is the same for all online procedures, and the routines always have the same names.

When you transmit data from a form, edits based on the form definition are performed first. Control then transfers to the online program's procedure division. For information, see Application Form Definition.

When control transfers to the program, it invokes 200-EDIT-TRAN, which in turn invokes all edits for the program. If the data passes the edits, control transfers to 400-PROCESS-TRAN.

The first edit performed is 210-EDIT-ACCESS. This routine edits the key fields on the form. If these edits are passed and the program performs update functions, 230-EDIT-DATA edits the other nondetail fields on the form. If a form has a detail area, 260-EDIT-DTL-TRAN edits the detail fields on the form. 220-EDIT-DELETE and 262-EDIT-DTL-DELETE perform edits that must be passed before a record can be deleted (for example, you cannot delete a department that has active employees).

If all the edits are passed, the data on the form is processed according to the specified form action. The following table shows which routines are performed when a form action is specified.

Form action Environment routine(s) performed
A (Add)

410-ADD

On detail forms, 422-PROCESS-DETAIL and 431-ADD-FilePrefix are performed for each detail line.

C (Change)

420-CHANGE

On detail forms, 422-PROCESS-DETAIL and 432-CHANGE-FilePrefix are performed for each detail line.

D (Delete)

440-DELETE

On detail forms, 422-PROCESS-DETAIL and 434-DELETE-FilePrefix are performed for each detail line.

I (Inquire) 480-INQUIRE

Online program paragraphs are divided into distinctly numbered sections. The following table lists the reserved number groups. Number the routines you write in one of the unreserved number groups.

Range Description
000-199 Environment routines.
200-299 Online form edit routines.
400-480 Process form fields.
500-610 Moves data to or from form fields.
800-899 Database input/output routines.
900-999 Database administration routines.

Database input/output and administration routines (paragraphs numbered 800-999) are explained in Doc for Developers: Lawson 4GL Application Program Interfaces.