Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Introduction to External Program Interfaces : Using MEMPTR to reference external data
 

Using MEMPTR to reference external data

The ABL MEMPTR data type provides a means to access (unmarshal and marshal) data that you plan to pass to and from other application and system environments using the following EPIs:
*UNIX shared object libraries and Windows dynamic link libraries (DLLs)
*Sockets
*XML
A MEMPTR variable references a region of memory set to a size that you specify. Once you declare and initialize the MEMPTR variable to the specified size, you can read and modify the memory region it references as follows:
*Read and write data values to specified locations within the MEMPTR region. These values can contain different numbers of bytes, depending on a data type that you specify for the value read or written.
*Read and write individual bits within an ABL INTEGER variable, whose value you can also read and write to a MEMPTR region.
*Assign values between two MEMPTR variables and between a MEMPTR variable and a RAW variable (or field).
*Indicate the byte order of data you have written so that a target system can interpret the MEMPTR data appropriately. This is primarily useful for exchanging MEMPTR data between different system environments using sockets.
Together, these features allow you to store and access data aggregates (structures), including complete OpenEdge database records.
The following sections describe the general capabilities of MEMPTR data, including:
*Comparing MEMPTR and RAW data types
*Initializing and uninitializing MEMPTR variables
*Reading and writing data in MEMPTR variables
*Retrieving and storing pointers
*Setting byte order
For more information on using MEMPTR for a specific EPI, see:
*UNIX shared library and Windows DLL support, and Shared Library and DLL Support
*Sockets, and Sockets
* Comparing MEMPTR and RAW data types
* Initializing and uninitializing MEMPTR variables
* Reading and writing data
* Retrieving and storing pointers
* Setting byte order