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 ObjectsHow You Can Reference ObjectsIn OpenROAD, you do not reference objects directly. Instead, every object isassociated with a reference variable. A reference variable is a variable thatpoints to an object of a given class, letting you access the value of an object.For example, to manipulate a value stored in a field, you use the field'svariable name directly:acct_balance = 1000.00However, to manipulate the field as an object, accessing such characteristicsas its background color or executing one of its methods, you must access thefield's reference variable. A reference variable lets you manipulate all of theattributes and methods of that field's class. Whereas the variable storing thefield's value is scalar, reference variables are pointers to compound datastructures that reference all the object's attributes and methods.A reference variable does not store an object's data values. Instead, when youreference the reference variable, OpenROAD uses the values stored in thecorresponding object's attributes. If there is no corresponding object, the valueof the reference variable is null.An object's properties are stored in the attributes that define the object.Attributes can be:• Simple data items, such as background color• Other reference variables, such as an image used for a button label• Dynamic array variables, such as the ChildFields array associated with acomposite fieldIn 4GL code, you can work with individual attributes of the object (such as thebackground color) or with the object as a whole. Working with the wholeobject allows you, for example, to retrieve a row from a database table andassign all values from the row to a single object. You can then easily map theobject to a set of fields in a subform or a row in a table field, or pass it as aunit to a procedure.114 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!