HANDLE

Declares a variable as a pointer to a structure type. This kind of variable is called a handle.

Its format is:

HANDLE[32 | 64] {struct-type-name | (struct-type-name)}
32
HANDLE(32) - four bytes in size and full-word-aligned by default. Default setting for 32-bit mfplx.
64
HANDLE(64) - eight bytes in size and double-word-aligned by default. Default setting for 64-bit mfplx, and valid only with 64-bit mfplx.
struct-type-name
The typed structure to which this handle points.

Handles are strongly typed in much the same way as defined structures. You can assign them to and compare them with handles for the same structure type. Handles do not allow arithmetic operations.

For example, the handle declared here locates the Coordinates type. The address of Daterec is assigned to that handle.

define STRUCT 1 Coordinates,

              2 x fixed bin(31),

              2 y fixed bin(31);

           

dcl P_coordinate handle Coordinates;

dcl a_coordinate type Coordinates;

P_coordinate = handle(a_coordinate);
The following is not supported:
  • Assigning a HANDLE(32) to a HANDLE(64) or its reverse.
  • Handle operations such as those involving comparison: +, -, +=, -=, and =>