Example: orders.4gl (MAIN block)
This MAIN block of the orders.4gl module is the
entry point of the progam execution.
MAIN block in orders.4gl: 1 MAIN
2 DEFER INTERRUPT
3
4 CONNECT TO "custdemo"
5
6 OPEN FORM f1 FROM "orders"
7 DISPLAY FORM f1
8
9 CALL orditems_dialog()
10
11 END MAINNote:
- Line
2declares the we defer the interruption events. If the program receives theSIGINTsignal, it will continue. - Line
4establishes an SQL connection to the database identified by thecustdemodata source. The SQL connection parameters are defined in the fglprofile file. - Line
6loads the main form of the program, defined in the orders.per file compiled as orders.42f. - Line 7 displays the loaded form into the current window, which is the default
SCREENwindow. - Line
9gives the control to theorditems_dialogfunction.