OPTIONS FIELD ORDER { CONSTRAINED | UNCONSTRAINED | FORM }
Tabbing order is used in interactive instructions such as INPUT, INPUT ARRAY or CONSTRUCT, where individual fields can get the focus.
The FIELD ORDER runtime option defines the default behavior when moving from field to field with the TAB and SHIFT-TAB keys in GUI mode, and with the Up / Down arrow keys in TUI mode.
By default, the tabbing order is defined by the list of fields used by the program instruction. This corresponds to FIELD ORDER CONSTRAINED option, which is the default.
When using FIELD ORDER UNCONSTRAINED in TUI mode, the Up and Down arrow keys will move the cursor to the field above or below the current field, respectively. When using the default FIELD ORDER CONSTRAINED option, the Up and Down arrow keys move the cursor to the previous or next field, respectively. If FIELD ORDER UNCONSTRAINED is used, the Dialog.fieldOrder FGLPROFILE entry is ignored.
The UNCONSTRAINED option can only be supported in TUI mode, with a simple form layout. It is not recommended to use this option in sGUI mode.
The FIELD ORDER FORM option instructs interactive instructions to use the tabbing order defined by the TABINDEX attributes of the current form fields. With this option, tabbing order can be defined in the layout of the form, independently from the program instruction. This is the preferred way in GUI mode. When FIELD ORDER FORM is used, the Dialog.fieldOrder FGLPROFILE entry is ignored.
Form "form1.per":
LAYOUT GRID { First name: [f001 ] Last name: [f002 ] Address: [f003 ] } END END ATTRIBUTES EDIT f001 = FORMONLY.fname, TABINDEX = 2; EDIT f002 = FORMONLY.lname, TABINDEX = 1; EDIT f003 = FORMONLY.address, TABINDEX = 0; ENDModule "main.4gl":
MAIN DEFINE fname, lname CHAR(20), address CHAR(50) OPTIONS INPUT WRAP OPEN FORM f1 FROM "f1" DISPLAY FORM f1 OPTIONS FIELD ORDER CONSTRAINED INPUT BY NAME fname, address, lname OPTIONS FIELD ORDER UNCONSTRAINED INPUT BY NAME fname, address, lname OPTIONS FIELD ORDER FORM INPUT BY NAME fname, address, lname END MAIN