Application Overview

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 .per 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 program modules.

The options to retrieve data or exit are defined as actions in a MENU statement. 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 corresponding ON ACTION clause 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 various kind of form fields such as checkboxes and comboboxes. Form objects that are associated with an action are called action views. Form objects that associated to program variables controlled by the current dialog instruction are called form fields.

Figure: Form with form fields, push buttons, labels and a displayed message

This figure shows a form with form fields, push buttons, labels and a displayed message.