Try OpenEdge Now
skip to main content
Java Open Clients
Using the Open Client Java OpenAPI to Directly Access the AppServer : Setting up parameters : Defining the return type for a user-defined function
 

Defining the return type for a user-defined function

You must specify the return type for a user-defined function as part of setting up the parameters. You can set this return type using the following method on the com.progress.open4gl.javaproxy.ParamArray object:
Syntax
public void setReturnType(int proType) throws Open4GLException
proType
Specifies an ABL data type returned by the user-defined function and indicated by a class constant defined in the com.progress.open4gl.Parameter class, as shown in the following table.
Note: User-defined functions cannot return LONGCHAR and MEMPTR data across an AppServer.
Table 34. User-defined function return types for the OpenAPI
ABL data type
com.progress.open4gl.Parameterclass constant
CHARACTER
PRO_CHARACTER
COM-HANDLE
PRO_COMHANDLE
DATE
PRO_DATE
DATETIME
PRO_DATETIME
DATETIME-TZ
PRO_DATETIMETZ
DECIMAL
PRO_DECIMAL
INT64
PRO_INT64
INTEGER
PRO_INTEGER
LOGICAL
PRO_LOGICAL
RAW
PRO_RAW
RECID
PRO_RECID
ROWID
PRO_ROWID
WIDGET-HANDLE
PRO_WIDGETHANDLE
For example, to set the return type for a user-defined function to the ABL INTEGER data type, you can invoke the setReturnType() method on a ParamArray object, parms, as follows:
parms.setReturnType(Parameter.PRO_INTEGER);