Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Shared Library and DLL Support : Executing a shared library routine : Parameter data types
 
Parameter data types
While shared library parameter definitions use a special set of data types, the corresponding expressions, fields, and variables passed in the RUN statement or SET-PARAMETER( ) method of the call object handle have standard ABL data types. You must ensure that your ABL parameters have data types that are compatible with their corresponding shared library parameter definitions. The following table lists each shared library parameter data type and its compatible ABL data type.
Table 54. Compatibility of shared library and ABL parameters
Shared library parameter data types
ABL parameter data types
BYTE
INTEGER, INT64
SHORT
INTEGER, INT64
UNSIGNED-SHORT
INTEGER, INT64
LONG
INTEGER, INT64
UNSIGNED-LONG
INTEGER, INT64
INT64
INTEGER, INT64
FLOAT
DECIMAL
DOUBLE
DECIMAL
CHARACTER
CHARACTER
MEMPTR
MEMPTR
Caution: For CHARACTER parameters, ABL always passes the routine a pointer to the character or character string value rather than the value itself. If the routine modifies the value, it can also modify ABL memory outside the bounds of the CHARACTER value with unpredictable results. For this reason, ABL does not allow you to use OUTPUT or RETURN for CHARACTER or LONGCHAR parameters, as well as CHARACTER or LONGCHAR array parameters. PSC does not recommend using INPUT-OUTPUT for CHARACTER or LONGCHAR parameters. Rather, pass the character string as a MEMPTR parameter. For more information, see Passing CHARACTER values to shared library routines. For more information on passing a MEMPTR parameter, see UsingMEMPTR variables as parameters.
Note: You cannot use any type of array for a RETURN parameter.