SET-POINTER-VALUE statement
- Last Updated: April 14, 2026
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Sets a variable of type MEMPTR to the value of a particular memory location.
Note: Does not
apply to SpeedScript programming.
Syntax
|
- memptr-var
- A reference to a variable defined as MEMPTR.
- memptr-value
- An integer that represents a memory location.
Example
The following example calls a DLL routine that returns a pointer to a
structure, extracts an address at byte 5 of the structure, uses
SET-POINTER-VALUE to assign the address to an ABL MEMPTR, and displays
the character string at the address:
|
CAUTION: In the example above,
SET-POINTER-VALUE assigns MEMPTR name to a location
within the memory allocated for person_struct. This is a common case
where the memory pointed to by SET-POINTER-VALUE was not directly allocated
by the shared library. Do not call SET-SIZE(memptr-var) =
0 on such a MEMPTR. The AVM will attempt to free that memory, which causes memory
corruption and AVM instability. Instead, reset the pointer with
SET-POINTER-VALUE(memptr-var) = ? when you are done
with it.Notes
SET-POINTER-VALUEis particularly useful when accessing Windows Dynamic Link Library (DLLs) or UNIX shared library routines from ABL. For more information on DLLs, see the topics on DLLs in OpenEdge Programming Interfaces.- For more information on the MEMPTR data type, see OpenEdge Programming Interfaces.