Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Introduction to External Program Interfaces : Using MEMPTR to reference external data : Reading and writing data : Copying between basic ABL data types and MEMPTR
 
Copying between basic ABL data types and MEMPTR
The following table lists the basic ABL data types and how you can copy them in and out of a MEMPTR variable.
Table 48. Copying between basic ABL data types and MEMPTR
Data type
Copying to/from MEMPTR
DATE
To copy into a MEMPTR:
*Use INTEGER(date-expression) to obtain an integer value
*Use the PUT-LONG statement to copy integer value to MEMPTR
To copy from a MEMPTR:
*Use the GET-LONG function to return the integer value
*Use the DATE(integer-expression) function to return the date
DECIMAL1
To copy into a MEMPTR, use the PUT-DOUBLE or PUT-FLOAT statement.
To copy from a MEMPTR, use the GET-DOUBLE or GET-FLOAT function.
INTEGER2
To copy into a MEMPTR, use the PUT-LONG, PUT-SHORT, PUT-UNSIGNED-SHORT, or PUT-BYTE statements.
To copy from a MEMPTR, use the GET-LONG, GET-SHORT, GET-UNSIGNED-SHORT, or GET-BYTE functions.
LOGICAL3
To copy into a MEMPTR, use the PUT-LONG, PUT-SHORT, PUT-UNSIGNED-SHORT, or PUT-BYTE statements.
To copy from a MEMPTR, use the GET-LONG, GET-SHORT, GET-UNSIGNED-SHORT, or GET-BYTE functions.
RAW
To copy into a MEMPTR, assign the RAW value directly using an assignment statement or use the PUT-RAW statement.
To copy from a MEMPTR, assign the MEMPTR value directly using an assignment statement or use the GET-RAW function.

1 The choice of exact statement or function to use depends on the data type used by the shared library routine or the socket application with your application is communicating.

2 The choice of exact statement or function to use depends on the data type used by the shared library routine or the socket application with your application is communicating.

3 The choice of exact statement or function to use depends on the data type used by the shared library routine or the socket application with your application is communicating.