This section deals with the special statements that assign pointers (references) pointing to existing data objects to field symbols and data references.
When you work with field symbols and data references that contain references to data objects, note the following:
- In a normal assignment between field symbols, as occurs with the statement
MOVE, each field symbol is handled as a dereferenced pointer (value semantics).
- In a normal assignment between data references, as occurs with the statement
MOVE, the references are copied (reference semantics). The corresponding rules can be found at the conversion rules for reference variables.
The statements for assigning data objects to field symbols and data references are:
- If you set references with
GET REFERENCE, then permission to access the data object in question is only checked at the position of the statement. After that, the references can be passed on to any destination and you can access the corresponding data objects from any position using the references. To prevent access to private and read-only attributes using references outside classes, do not publish references to these attributes externally.