Progress
External Program
Interfaces
Comparing MEMPTR and RAW Data Types
Progress 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 the 4GL or that you import from another environment using an EPI.
- You can use MEMPTR variables to directly exchange data between the 4GL and a supported EPI environment; you can use RAW variables only to exchange data with another 4GL data type, including MEMPTR.
- You can define RAW fields in a Progress 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 4GL and Progress database environment, while the MEMPTR data type supports the storage and movement of data between the local 4GL and external 4GL or non-4GL environments.
You can also assign values between MEMPTR and RAW variables directly using the 4GL assignment operator (=). If the target variable is RAW, Progress 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 previous versions of Progress, 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. With Version 9.1, each variable refers to a completely separate copy of the data. However, passing a MEMPTR parameter to a local procedure remains pass by reference, and MEMPTR parameters to a remote procedure are passed by value, as with assignment statements.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |