2. Language Elements : Variables : Reference Variables
 
Share this page                  
Reference Variables
A 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 data structure that holds values that you can manipulate. A reference variable does not store its own values. Instead, when you reference the reference variable, OpenROAD uses the values in the corresponding object. The object is made up of attributes, which can be simple variables, reference variables, or array variables.
The class of an object defines its attributes. OpenROAD includes both system classes and user-defined classes.
In your 4GL code, when you reference a reference variable, you can work with the entire object as a single unit. For example, you can retrieve a row from a database table and assign all values from the row to a single object and then pass the object to a called procedure. You can also work with the individual attributes in the object. For examples of each case, see How You Can Use Reference Variables (see How You Can Use Reference Variables).