Progress
Language Reference


SET-POINTER-VALUE Statement

Interfaces
OS
SpeedScript
All
Windows only
No

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

SYNTAX

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

memptr-value

A 32-bit integer that represents a memory location.

memptr-expression

An expression that evaluates to a value of type MEMPTR.

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 a Progress MEMPTR, and displays the character string at the address.

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

NOTES

SEE ALSO

GET-POINTER-VALUE Function, SET-SIZE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095