Using MEMPTR to reference external data
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
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
MEMPTRregion. 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
INTEGERvariable, whose value you can also read and write to aMEMPTRregion. - Assign values between two
MEMPTRvariables and between aMEMPTRvariable and aRAWvariable (or field). - Indicate the byte order of data you have written so that a target
system can interpret the
MEMPTRdata appropriately. This is primarily useful for exchangingMEMPTRdata 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
MEMPTRandRAWdata types - Initializing and uninitializing
MEMPTRvariables - Reading and writing data in
MEMPTRvariables - Retrieving and storing pointers
- Setting byte order
For more information on using MEMPTR for a specific EPI,
see: