Each field is associated with an active, an inactive, and a skip logical video attribute. The active field attribute is used to display the field that is the current field (that is, the cursor is in the field). The skip field attribute is used to display fields that the cursor cannot land in (that is, the field has the SKIP option set ON). The inactive field attribute is used to display all other fields on the data form.
When you define a field, the field uses default attributes for the inactive, active, and skip logical attributes (LFLDINACT, LFLDACT, and LSKIP respectively). You can change these attributes to give visual cues to the user that a certain field is different from the others.
Designer: You can change field attributes in the Designer. See the Designer User's Guide for more information. You can also change the field attributes in your code, by calling the function sf_att(), described below.
Code: You can change field attributes at any time after defining the field with a call to fld_def().
To change the active, inactive, and skip attributes associated with a field in your code, use the set field attributes function, sf_att():
|
where active_att, inactive_att, and skip_att are the logical attributes to use and fldp is the field for which to change the attributes. You can specify NOCHANGE for any attribute that you do not want to change.
Also, you may wish to create additional logical attributes, say, for inactive PROTECTED fields (fields the user can go to but cannot edit the field contents) or for inactive and active REQ_AT_EXIT fields (fields the user must enter data into before exiting the data form). You could define logical attributes for LPROTECTED, LREQACT and LREQINACT and then set the appropriate fields with these attributes. Chapter 46, "Controlling Color with Logical Attributes," explains how to modify and add logical attributes.
The following code example shows how to change the attributes for a field. The active attribute is set to LHIGHLITE, the inactive attribute is set to LREVERSE, and the skip attribute is left unchanged.
|