Pointers
The Pointer Data Definition Label holds a memory address and may be used in normal PL/B instructions in a transparent fashion. Once assigned to a valid data, object, or file definition of the same type, a Pointer may be used interchangeably with it, making Pointers particularly useful for the emulation of parameterized calls within a program. They use the following format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
^
Optional. Denotes the item as a POINTER.
var
Required. The name of a previously defined variable or object of the same type.
arraysize
Optional. An integer decimal constant, CONST variable or EQUATEd value indicating the number of array items or the name of a previously defined array of the same type.
Flags Affected: NONE
Note the following:
A Pointer must reference a Label or another Pointer of the same type (i.e., DIM to DIM, FORM to FORM, FILE to FILE, BUTTON to BUTTON, etc.).
Formats (1) - (11) that do not have the optional {label} defined must be initialized by the target of a parameterized call instruction or an SMAKE, MOVEADDR, or MOVEPTR instruction before use. Failure to do so results in a Format Error (F04 or F02). An undefined Pointer in a variable list may generate indeterminate results since the instruction processes the list of variables up to the Pointer.
Formats (1) - (8) that specify the optional {label} are initialized at compile time to the address of {label}.
Pointers become invalid after a ROLLOUT or in the child process of a FORK. They must be re-initialized if used again.
Pointers may not be declared as Common Data Items and are null after a CHAIN.
The optional dot [.] in formats (2) and (13) indicate the field points to a variable containing a decimal point. When present, fractional temporary fields are used for CALC and MOVE statements.
(OBJECT) pointers may be defined for any valid object type.
See Also: Data Definitions, MOVEADDR, ROUTINE, SMAKE
![]() |