Admin Production rocket
Current Publication

POINTER Function

Enterprise Developer for Eclipse (including UNIX Components) V7.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

POINTER Function

Purpose

Returns a pointer value specifying the generation of a based variable in an area.

Syntax

POINTER(o,a)

Abbreviation(s): PTR for POINTER.

Parameters

o is an offset reference that specifies the generation of a based variable in the area identified by a.

Description

If o is the null offset value, the POINTER function returns the null pointer value; otherwise, the value of o must be the offset of some based variable's allocation in an area, but not necessarily in a.

The result returned by the POINTER function is the sum of the offset value, o, plus the address of the beginning of the area, a.

Examples

DECLARE (A, B) AREA;
DECLARE (A1, A2) CHAR(20) BASED; 
DECLARE (P1, P2) POINTER;
DECLARE (O1, O2) OFFSET;

ALLOCATE A1 IN(A) SET(O1);
ALLOCATE A2 IN(A) SET(O2);

B = A;                  /* assign area */

P1 = POINTER(O1, B);    /* address of A1 in B */
P2 = POINTER(O2, B);    /* address of A2 in B */

Restrictions

None.