User interface / Display of static information |
The DISPLAY TO instruction displays data to form fields explicitly.
DISPLAY expression [,...] TO field-spec [,...] [ ATTRIBUTE ( display-attribute [,...] ) ]
{ field-name | table-name.* | table-name.field-name | screen-array[line].* | screen-array[line].field-name | screen-record.* | screen-record.field-name } [,...]
{ BLACK | BLUE | CYAN | GREEN | MAGENTA | RED | WHITE | YELLOW | BOLD | DIM | NORMAL | REVERSE | BLINK | UNDERLINE }
When the program variables do not have the same names as the form fields, you must use the TO clause to explicitly map the variables to fields. You can list the fields individually, or you can use the screen-record.* or screen-record[n].* notation, where screen-record[n].* specifies all the fields in line n of a screen array.
DISPLAY p_items.* TO s_items[1].*
DISPLAY p_customer.* TO s_customer.*
DEFINE p_customer RECORD customer_num LIKE customer.customer_num, fname LIKE customer.fname, lname LIKE customer.lname, phone LIKE customer.phone END RECORD
ATTRIBUTES f000 = customer.customer_num; f001 = customer.fname; f002 = customer.lname; f003 = customer.phone; END
The DISPLAY TO statement changes the 'touched' status of the target fields. When you modify a field value with this instruction, the FIELD_TOUCHED() operator returns true and the ON CHANGE and ON ROW CHANGE triggers may be invoked if the current field value was changed with a DISPLAY BY NAME.
In dialogs controlling field input such as INPUT or INPUT ARRAY, use the UNBUFFERED attribute to display data to fields automatically without changing the 'touched' status of fields. The UNBUFFERED clause will make automatic form field and program variable synchronization. When using the UNBUFFERED mode, the touched flag can be set with DIALOG.setFieldTouched() if you want to get the same effect as a DISPLAY BY NAME
The REVERSE, BLINK, INVISIBLE, and UNDERLINE attributes are not sensitive to the color or monochrome status of the terminal, if the terminal is capable of displaying these intensity modes. The ATTRIBUTE clause can include zero or more of the BLINK, REVERSE, and UNDERLINE attributes, and zero or one of the other attributes. That is, all of the attributes except BLINK, REVERSE, and UNDERLINE are mutually exclusive.
The DISPLAY TO statement ignores the INVISIBLE attribute, regardless of whether you specify it in the ATTRIBUTE clause.