PreviousNextIndex

SET-POINTER-VALUE statement

Sets a variable of type MEMPTR to the value of a particular memory location.

Note: Does not apply to SpeedScript programming.
Syntax

SET-POINTER-VALUE ( memptr-var ) = memptr-value 

memptr-var
memptr-value
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:

DEFINE VARIABLE person_struct AS MEMPTR NO-UNDO. /* pointer to structure */ 
DEFINE VARIABLE name          AS MEMPTR NO-UNDO. /* pointer to name */ 
SET-SIZE(person_struct) = 8. 
RUN person_info (OUTPUT person_struct). 
SET-POINTER-VALUE(name) = GET-LONG(person_struct,5). 
DISPLAY GET-STRING(name,1) FORMAT "x(50)". 
SET-SIZE(person_struct) = 0. 
PROCEDURE person_info EXTERNAL "person.dll" PERSISTENT: 
  DEFINE OUTPUT PARAMETER person_struct AS MEMPTR. 
END PROCEDURE. 

Notes
See also

GET-POINTER-VALUE function, SET-SIZE statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex