4. Working with Classes : How You Can Reference Objects : How You Can Set and Get Attributes : reference_variable.attribute = expression
 
Share this page                  
reference_variable.attribute = expression
reference_variable
Specifies the name of the reference variable that points to the object
attribute
Specifies any one of the attributes defined for the object's system class
expression
Specifies any 4GL expression that is the appropriate type for the particular attribute
The following example changes the mode of the current frame by setting the value of the CurMode attribute to FM_READ:
CurFrame.CurMode = FM_READ;
To set the value of an attribute for a field or menu item, you must use the field function in the assignment statement. The syntax is:
field(display_variable).attribute = expression
The following example uses the field function to set the value of the CurBias attribute for the Create button:
field(create_button).CurBias = FB_INVISIBLE;
Note:  When you set the value of an attribute for a child field inside a named composite field, you must specify the full name of the field. To change the bias of the cname field in the customer subform, for example, you would use the following statement:
field(customer.cname).CurBias = FB_INVISIBLE;
There are also occasions when you want to get an attribute's value. For example, you may want to learn which field has the current input focus or which field triggered an event. The process for getting the value of an attribute is very similar to that for setting one. Use an assignment statement to obtain the value of the attribute. The basic format is: