Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Shared Library and DLL Support : Executing a shared library routine : INT64 parameter conversions
 
INT64 parameter conversions
Differing integer sizes for DLL parameter data types and ABL data types require automatic conversions between these types. Passing a larger data type to a smaller data type will convert the larger data type to the smaller data type. If the value of the larger data type is greater than what would fit in the smaller data type, ABL generates an overflow error at run time. Passing a smaller data type to a larger data type automatically converts the smaller data type to a larger data type.
For example:
*When passing an INT64 value to a BYTE, SHORT, UNSIGNED-SHORT, LONG or UNSIGNED-LONG DLL parameter, ABL automatically passes the appropriate number of low-order bytes of the INT64 value to the DLL function. If the INT64 value is larger than what would fit in the target data type, ABL generates an overflow error.
*When passing an INTEGER value to an INT64 DLL parameter, ABL provides an automatic conversion of the value to INT64.
*When returning a BYTE, SHORT, UNSIGNED-SHORT, LONG or UNSIGNED-LONG INPUT-OUTPUT or OUTPUT DLL parameter to an INT64 variable, ABL provides an automatic conversion to INT64.
*When returning a BYTE, SHORT, UNSIGNED-SHORT, LONG or UNSIGNED-LONG RETURN DLL parameter to an INT64 variable, ABL provides an automatic conversion to INT64.
*When returning an INT64 DLL parameter to an INTEGER variable, ABL passes only the low-order 4 bytes to the INTEGER, ignoring the high-order bytes. If the returned value is larger than what would fit in an INTEGER, ABL client generates an overflow error.
*When returning an UNSIGNED-LONG to an INTEGER variable, ABL provides an automatic conversion to INTEGER. If the UNSIGNED-LONG value is larger than the maximum value of an INTEGER, ABL generates an overflow error.