10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Reference ObjectsField FunctionEvery field or menu item has two variables associated with it:The data variableStores the data that is displayed in a field. OpenROAD declares thisvariable automatically when you create the field or menu item using theOpenROAD Workbench.The reference variablePoints to the field object. The field object contains information about thefield itself, such as its size or color, as well as containing the datadisplayed in the field. To access this reference variable, you must use thefield function. The field function returns the reference variable that isassociated with the field object. The basic format is:field(display_variable)When you want to reference an attribute of a field object, use the fieldfunction to specify the reference variable as follows:field(display_variable).attributeIn the following example, the if statement uses the field function to referencethe UpdateBias attribute of the customer field:if field(customer).UpdateBias = FB_VISIBLE thenHow You Can Set and Get AttributesSetting an attribute in 4GL may change the appearance or behavior of theobject. For example, setting the value of the FileHandle attribute for theBitmapObject system class actually causes OpenROAD to load a bitmap imageinto the object.Sometimes setting an attribute for one object affects other objects. Forexample, if you set the InputFocusField attribute of the FrameExec object,OpenROAD moves the input focus from the current field to the field youspecify; doing so triggers appropriate Exit and Entry events for the fields.Working with Classes 117

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!