Consultor Eletrônico



Kbase P100623: How to use MEMPTR Memory Pointers
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/01/2006
Status: Unverified

GOAL:

How to use MEMPTR Memory Pointers

GOAL:

Using a Memory Pointer MEMPTR

FIX:

Memory is allocated and de-allocated using the set-size() function.
The programmer is completely responsible for everything associated with this portion of memory. It cannot be added to pools so the only thing we guarantee is that when the session goes away, it goes away with it. There are functions to manipulate it, but Progress does not recognizes the contents. The data type of a field defines what kind of data the field can store. All data types other than the MEMPTR data type are limited in size to 32K. MEMPTR variables can be any size.
Memory Pointer example:
DEFINE VARIABLE Mptr AS MEMPTR.
DEFINE VARIABLE CString AS CHARACTER NO-UNDO.
SET-SIZE(Mptr)= 53631385.
PUT-BYTE(Mptr,1) = 65.
PUT-STRING(Mptr,213) = "SmartNews 2003".
CString = GET-STRING(Mptr,1).
DISPLAY CString.
SET-SIZE(MPTR) = 0.