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.

VariablesIn the first example, film.director is a simple variable that is an element of areference variable. In the second, movies[].title is a simple variable that is anelement of an array.For information about referencing the individual elements in a reference orarray variable, see Reference Variables (see page 28) and Dynamic ArrayVariables (see page 31).Reference VariablesHow You Can Declare Reference VariablesA reference variable is a variable that points to an object of a given class,letting you access the value of an object. An object is a compound datastructure that holds values that you can manipulate. A reference variable doesnot store its own values. Instead, when you reference the reference variable,OpenROAD uses the values in the corresponding object. The object is made upof attributes, which can be simple variables, reference variables, or arrayvariables.The class of an object defines its attributes. OpenROAD includes both systemclasses and user-defined classes. For more information about the systemclasses, see the Language Reference <strong>Guide</strong> online help.In your 4GL code, when you reference a reference variable, you can work withthe entire object as a single unit. For example, you can retrieve a row from adatabase table and assign all values from the row to a single object and thenpass the object to a called procedure. You can also work with the individualattributes in the object. For examples of each case, see How You CanReference Reference Variables (see page 29).To declare a reference variable, use the following syntax:name = class [ [with] default null]The value of class can be any named user class or system class (for acomplete list of system classes, see the Language Reference <strong>Guide</strong> onlinehelp). The following example declares a reference variable of the StringObjectclass:strobj = StringObject;All reference variables are nullable.28 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!