Form file structure / LAYOUT section |
Reuse the definition of a form in the current form.
FORM "form-file"
None.
The FORM clause includes an external form at the current layout position, enforcing form re-usability, or to solve form complexity when using a DIALOG instruction. For example to define a common form header for several application forms.
Wherever a layout container can be specified, the layout of an external form can be merged into the layout of the current form, with the FORM clause.
The .per source of the included form must be readable. If the compiled version (.42f) does not exist, or is older as the .per source, fglform will automatically compile the included form.
The form compiler searches for the external form relative to the path of the current compiled form. For example, with fglform dir1/dir2/main.per, when the main form includes an external form with FORM "../otherdir/subform", fglform will include the form file located in dir1/otherdir/subform.per.
The form compiler performs an up to date test of the compiled form. Error -6842 will the thrown if the up to date test fails.
If the external form contains a TOOLBAR or a TOPMENU section, error -6841 will be thrown.
The external form must not define a SCREEN RECORD or use a TABLE already been defined in the current form, otherwise error -2024 will be thrown. Consider using the table alias syntax to avoid duplicate table names in merged forms.
The external form can define its own ACTION DEFAULTS section. The action defaults of the external file will be merged into the action defaults of the current form.
The TABINDEX attributes of the elements of the result form will be adjusted. As the result tabbing (OPTIONS FIELD ORDER FORM in programs) keeps the visual order of the layout.
LAYOUT FOLDER PAGE page1 (TEXT = "Customer") FORM "customer" END PAGE page2 (TEXT = "Orders") FORM "orders" END END END