Reference compatibility in EGL

Reference compatibility rules apply in the following circumstances:
The rules for reference compatibility in EGL are as follows:
  1. Two values are reference compatible only when they refer to the same primitive type. Note that a CHAR(7) is not reference compatible with a CHAR(8).
  2. A non-structured record is reference compatible with another non-structured record only when each field in the source is the same type as each field in the target.
  3. A structured record is reference compatible with another structured record (or a CHAR variable) only if the source record is the same length or longer than the target. Compatibility of individual fields is not an issue.

You can assign a value-type variable to a reference variable. In this case, EGL copies the value of the non-reference variable to a new area of memory and points the reference variable to this new area. The two types must be assignment compatible. The source type is converted to the target type if the two types differ.

You can assign a reference variable to a value-type variable. In this case, the non-reference variable takes on the value that the reference variable points to. The two types must be assignment compatible. The source type is converted to the target type if the two types differ.

A value-to-reference assignment also takes place when you call a function using one of the following arguments:

Feedback