Form Fields

In a 4GL form, a field (sometimes called a screen field or form field) is an area where the user of the application can view, enter, or edit data, depending on its description in the form specification file and statements in the form driver.

Form Specification File

A 4GL form specification file is an ASCII file (with file extension .PER) that you can create with a text editor or with the Form Compiler utility. This file consists of three required sections (DATABASE, SCREEN, and ATTRIBUTES) and it can also include two optional sections (TABLES and INSTRUCTIONS). If present, these five sections must appear in the following order:

DATABASE Section:Each form specification file must begin with a DATABASE section identifying the database (if any) on which the form is based. This can be any database that your database engine can access, including a remote database.

SCREEN Section:The SCREEN section must appear next, showing the dimensions and the exact layout of the logical elements of the form. You must specify the position of one or more screen fields for data entry or display, and any additional text or ornamental characters.

TABLES Section:The TABLES section must follow the SCREEN section of any form that references the identifier of a database column. This section lists every table or view that contains columns that are referenced in the ATTRIBUTES or INSTRUCTIONS sections. The TABLES section must also declare an alias for any table name or synonym that requires an owner qualifier, or that is an external table, or an external, distributed table.

ATTRIBUTES Section:The ATTRIBUTES section describes each field on the form and assigns names to fields. Field descriptions can optionally include field attributes to specify, for example, the appearance, acceptable input values, on-screen comments, and default values for each field.

INSTRUCTIONS Section:The INSTRUCTIONS section is optional. It can specify screen arrays, and non-default screen records.

Each section must begin with the keyword for which it is named. After you create a form specification file, you can use the Form Compiler to compile it. The form driver of your 4GL application can then use 4GL variables to transfer information between the database and the fields of the screen form.

This is the syntax of a 4GL form specification file:

4GLREF00000026.gif