Form specification files / Form file structure |
The ATTRIBUTES section describes properties of the elements used in the form.
ATTRIBUTES { form-field-definition | phantom-field-definition | form-item-definition } [...] [END]
item-type item-tag = field-name [ , attribute-list ] ;
PHANTOM field-name ;
item-type item-tag: item-name [ , attribute-list ] ;
The ATTRIBUTES section is mandatory, and must follow the LAYOUT section or if present, the TABLES section.
The END keyword is optional.
Every item-tag used in the LAYOUT section must be described in the ATTRIBUTES section.
A form item definition is associated by name to an item tag or layout tag defined in the LAYOUT section.
In order to define a form field, the form item definition must use the equal sign notation to associate a screen record field with the form item. If the form item is not associated with a screen record field (for example, a push button), you must use the colon notation.
To match the complete structure of a database table record, additional fields can be defined as phantom fields, when no corresponding item tag is used in the layout.
Form item definitions can optionally include an attribute-list to specify the appearance and behavior of the item. For example, you can define acceptable input values, on-screen comments, and default values for fields.
When no screen record is defined in the INSTRUCTION section, a default screen record is built for each set of form items declared with the same table name.
The order in which you list the form items determines the order of fields in the default screen records that the form compiler creates for each table.
To define form items as form fields, you are not required to specify table unless the name column is not unique within the form specification. However, it is recommended that you always specify table.column rather than the unqualified column name. As you can refer to field names collectively through a screen record built upon all the fields linked to the same table, your forms might be easier to work with if you specify table for each field.
When used in a table, some widgets are rendered only when the user enters in the field. For example RadioGroup, CheckBox, ComboBox, ProgressBar.
ATTRIBUTES EDIT f001 = player.name, REQUIRED, COMMENT="Enter player's name"; EDIT f002 = player.ident, NOENTRY; COMBOBOX f003 = player.level, NOT NULL, ITEMS=((1,"Beginner"), (2,"Normal"),(3,"Expert")); CHECKBOX f004 = FORMONLY.winner, VALUECHECKED=1, VALUEUNCHECKED=0, TEXT="Winner"; BUTTON b1: print, TEXT="Print Report"; GROUP g1: print, TEXT="Description"; END