Tutorial Chapter 3: Displaying Data (Windows/Forms) |
This example program opens a window containing a form to display information to the user.
The appearance of the form is defined in a separate form definition file. The program logic to display information on the form is written in the .4gl program module. The same form file can be used with different applications.
The options to retrieve data or exit are defined as actions in a MENU statement in the .4gl file. By default, push buttons are displayed on the form corresponding to the actions listed in the MENU statement. When the user presses the query button, the code listed for the action statement is executed - in this case, an SQL SELECT statement retrieves a single row from the customer table and displays it on the form.
A FORM can contain form fields for entering and displaying data; explanatory text (labels); and other form objects such as buttons, topmenus (dropdown menus), toolbar icons, folders, tables, and checkboxes. Form objects that are associated with an action are called action views. Messages providing information to the user can be displayed on the form.
Figure 1. Interface as displayed on Windows™ platforms