Consultor Eletrônico



Kbase P115858: How to convert RAW data to MEMPTR or vice-versa?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   4/16/2009
Status: Verified

GOAL:

How to convert RAW data to MEMPTR or vice-versa?

GOAL:

What is the compatibility between the RAW and MEMPTR data types?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1x
OpenEdge 10.x

FIX:

Data stored in a variable of type RAW can be copied to a MEMPTR variable, as well as the other way around, by means of the assignment operator (ASSIGN, =). However:
- when copying data from a RAW variable to a MEMPTR variable, the MEMPTR variable must have been previously initialized with a size large enough to hold the data from the RAW variable, using the SET-SIZE function. For example:
DEFINE INPUT PARAMETER r AS RAW NO-UNDO.
DEFINE VARIABLE m AS MEMPTR NO-UNDO.
SET-SIZE(m) = LENGTH(r).
m = r.
- when copying data from a MEMPTR variable to a RAW variable, only the first 32K of data in the MEMPTR area will be copied. Like all other Progress data types except MEMPTR, RAW is limited to 32K in size.