Retrieving and storing pointers
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Retrieving and storing pointers
In some cases (especially for shared library routines),
you might have to obtain a pointer to the memory region associated
with a MEMPTR variable. You might need this value,
for example, to build a structure that contains a pointer to another
structure. You can get a pointer to a MEMPTR region
by using the GET-POINTER-VALUE function. This is
the syntax for the GET-POINTER-VALUE function:
Syntax
|
For example, to retrieve the pointer to a memory region specified
by a MEMPTR variable (BitMapInfo) and store it
in the first byte position of another MEMPTR variable
(BitMaps), you can use the following statement (assuming 32-bit
pointers):
|
You can also store the address of a memory item into a MEMPTR variable
by using the SET-POINTER-VALUE statement. Here
is the syntax:
Syntax
|
For example, to store an address located at the second byte of
a MEMPTR variable (BitMaps) into another MEMPTR variable
(BitMapInfo), you can use the following statement:
|
For more information on the GET-POINTER-VALUE function
and the SET-POINTER-VALUE statement, see ABL Reference.