INSTRUCTIONS Section

The INSTRUCTIONS section is the optional final section of a form specification file. You can use this section to declare non-default screen records and screen arrays. The INSTRUCTIONS section appears after the last field description (or after the optional END keyword) of the ATTRIBUTES section.

4GLREF00000055.gif

array is the 4GL identifier for the screen array. (It is also the name of the screen record that comprises each line of the array.)

record is the 4GL identifier that you declare for the screen record.

size is a literal integer, enclosed in square ( [ ] ) brackets, to specify the number of screen records in the screen array.

Screen Records

A screen record is a group of fields that screen-interaction statements of the INFORMIX-4GL program can reference as a single object. By establishing a correspondence between a set of screen fields (the screen record) and a set of 4GL variables (typically a program record), you can pass values between the program and the fields of the screen record. In many applications, it is convenient to define a screen record that corresponds to a row of a database table.

Default Screen Records

INFORMIX-4GL recognizes default screen records that consist of all the screen fields linked to the same database table within a given form. The Form Compiler automatically creates a default record for each table that is used to reference a field in the ATTRIBUTES Section. The components of the default record correspond to the set of display fields that are linked to columns in that table.

The name of the default screen record is the table name (or the alias, if you declared an alias for that table in the TABLES section). For example, all the fields linked to columns of the customer table constitute a default screen record whose name is customer. If a form includes one or more FORMONLY fields, those fields comprise a default screen record called formonly.

Non-Default Screen Records

The INSTRUCTIONS section of a form specification file can declare non-default screen records. You use the SCREEN RECORD keywords of the INSTRUCTIONS section to declare a name for the screen record, and to specify a list of fields that are members of the screen record. A record declaration has this syntax

4GLREF00000056.gif

first is a field name that you declared in the ATTRIBUTES section.

last is a field name that you declared later than first.

record is the 4GL identifier that you declare for the screen record.

table reference is a table name, alias, or synonym (or FORMONLY keyword).

The field name is the SQL identifier of a database column linked to the field, unless you specify FORMONLY as the table reference).

The record name of a non-default screen record can have up to 50 characters, and must comply with the rules for 4GL identifiers.

Screen Arrays

A screen array is usually a repetitive array of fields in the screen layout, each containing identical groups of screen fields. Each "row" of a screen array is a screen record. Each "column" of a screen array consists of fields with the same field tag in the SCREEN section of the form specification file.

You must declare screen arrays in the INSTRUCTIONS section, using syntax like the syntax described for a screen record in the previous section, but with an additional parameter to specify the number of screen records in the array:

4GLREF00000057.gif

array is the 4GL identifier for the screen array. (It is also the identifier of the screen record that comprises each line of the array.)

size is a literal integer, enclosed in square ( [ ] ) brackets, to specify how many screen records are in the screen array.

The size should be the number of lines in the logical form where the set of fields that comprise each screen record is repeated within the screen array.