Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Introduction to External Program Interfaces : Using MEMPTR to reference external data : Comparing MEMPTR and RAW data types
 
Comparing MEMPTR and RAW data types
ABL provides two data types to store data in a raw (binary) form, MEMPTR and RAW. MEMPTR and RAW data types provide similar features, but serve different purposes, as follows:
*You can use both MEMPTR and RAW variables to store binary data that originates with any other data type in ABL or that you import from another environment using an EPI.
*You can use MEMPTR variables to directly exchange data between ABL and a supported EPI environment; you can use RAW variables only to exchange data with another ABL data type, including MEMPTR.
*You can define RAW fields in an OpenEdge database, but you cannot define MEMPTR fields. You can move database fields and records to and from MEMPTR variables using RAW variables as intermediate storage.
In sum, the RAW data type supports the storage and movement of binary data within the local ABL and OpenEdge database environment, while the MEMPTR data type supports the storage and movement of data between the local ABL and external ABL or non-ABL environments.
You can also assign values between MEMPTR and RAW variables directly using the ABL assignment operator (=). If the target variable is RAW, ABL resizes the target, if necessary, to make it the same size as the source. For both assignment between MEMPTR and RAW variables and assignment between two variables of the same data type, the source and the target variables maintain separate and complete copies of the data.
Note: In versions of OpenEdge prior to Progress Version 9.1, assignment from one MEMPTR variable to another created a copy of the pointer, not the data. Thus, both variables referred to the same data after the assignment. Starting with Version 9.1, each variable refers to a completely separate copy of the data. However, a MEMPTR parameter passed to a local procedure continues to be passed by reference, and a MEMPTR parameter passed to a remote procedure is always passed by value (the same as an assignment statement).