ATTRIBUTES Section
The ATTRIBUTES section specifies a field description that associates an
identifier and a data type with every field in the SCREEN section. You can also
control the behavior and appearance of each field by using field attributes to
describe how INFORMIX-4GL should display the field, supply a default value, limit
the values that can be entered, or set other parameters.
attribute is a string of keywords, identifiers, and symbols to specify a field attribute.
column is the unqualified SQL identifier of a database column.
data type is any data type specification except ARRAY or RECORD.
field name is an identifier that you assign to a FORMONLY field (a field that is not
associated here with any database column).
field-tag is the field tag, as declared in the SCREEN section.
table is the name or alias of a database table, synonym, or view, as declared in the TABLES section. This is not required, unless several columns in different tables have the
same name, or the table is an external table, or INFORMIX-STAR is being used to
access an external, distributed table.
The ATTRIBUTES section must describe every field-tag from the SCREEN section.
The order in which you list the field tags determines the order of fields in
the default screen records that INFORMIX-4GL creates for each table.
The END keyword is not required. It is supported to provide compatibility with
form specification files for earlier versions of Informix products.
You can specify two kinds of field descriptions: those that associate a field
tag with the data type and with the default attributes of a database column,
and those that link field tags to FORMONLY fields.
Related Attributes
Fields Linked to Database Columns
Unless a display field is FORMONLY, its field-description must specify the SQL
identifier of some database column as the name of the display field. Fields
are associated with database columns only during the compilation of the form
specification file. During the compilation process, the Form Compiler examines two
optional tables, syscolval and syscolatt, for default values of the attributes
that you have associated with any columns of the database.
After the Form Compiler extracts any default attributes and identifies data
types from the system catalog, the association between fields and database
columns is broken, and the form cannot distinguish the name of a table or view from
the name of a screen record. The form driver in your 4GL program must mediate
between screen fields and database columns with program variables
attribute is a string of keywords, identifiers, and symbols to specify a field attribute.
column is the unqualified SQL identifier of a database column. This can also appear
in 4GL statements that reference the field.
field-tag is the field tag, as declared in the SCREEN section.
table is the name or alias of a database table, synonym, or view, as declared in the
TABLES section. Qualifiers are not allowed.
Although you must include an ATTRIBUTES section that assigns at least one name
to every field-tag from the SCREEN section, you are not required to specify
any field attributes.
You are not required to specify table unless the column identifier occurs in
more than one table of the TABLES section, or if table is an external table, or
if INFORMIX-STAR is being used to access an external, distributed table. If
there is ambiguity, the Form Compiler issues an error during compilation.
Because you can refer to field names collectively through a screen record
built upon all the fields linked to the same table, your forms may be easier to
work with if you specify table for each field.
A screen field can display a portion of a character string by using subscripts
in the column specification. Subscripts are a pair of comma-separated integers
in square ( [ ] ) brackets to indicate starting and ending character positions
within a string value. But if you specify in the ATTRIBUTES section that two
fields are linked to the same character column in the database, you cannot
associate each field with a different substring of the same column.
FORMONLY Fields
FORMONLY fields are not associated with columns of any database table or view.
They can be used to enter or display the values of program variables.
If the DATABASE section specifies FORMONLY, this is the only kind of field
description that you can specify in the ATTRIBUTES section.
attribute is a string of keywords, identifiers, and symbols to specify a field attribute.
column is the unqualified SQL identifier of a database column.
field name is an identifier that you assign to a FORMONLY field. This can also appear in
4GL statements that reference the field.
field-tag is a field tag, as declared in the SCREEN section.
table is the name or alias of a table, synonym, or view, as declared in the TABLES
section. This is required if columns in different tables of the TABLES section
have the same name, or if table references an external table or an external,
distributed table.
Like other 4GL identifiers, field name cannot begin with a number. It can have
up to 50 characters, including letters, numbers, and underscore ( _ ) symbols.
If you specify one or more FORMONLY fields, INFORMIX-4GL behaves as if they
formed a database table named formonly, with the field names as column names. The
following are examples of FORMONLY fields:
Field Attribute Syntax
Syntax for assigning each of these attributes is described in the sections
that follow. For simplicity, these use the following syntax diagram format:
This format is simplified by ignoring fields with multiple attributes and by
ignoring the required semicolon ( ; ) that separates field descriptions. Here is
the complete syntax of a field description within the ATTRIBUTES section:
attribute is a string of keywords, identifiers, and symbols to specify a field
attribute, as described in the sections that follow.
column is the unqualified SQL identifier of a database column.
data type is any 4GL data type except ARRAY or RECORD.
field name is an identifier that you assign to a FORMONLY field.
field-tag is the field tag that you declared in the SCREEN section.
table is the name or alias of a table, synonym, or view, as declared in the TABLES
section. This is required if columns in different tables of the TABLES section
have the same name, or if table references an external table or an external,
distributed table.