Try OpenEdge Now
skip to main content
.NET Open Clients
Using the Open Client .NET OpenAPI to Directly Access the AppServer : Setting up parameters and return types : Defining the return type for a user-defined function : UnknownReturnType property
 
UnknownReturnType property
This property allows you to specify if and how the user-defined function can return the ABL Unknown value (?). This is the syntax:

Syntax

public Progress.Open4GL.UnknownType UnknownReturnType
Progress.Open4GL.UnknownType is an enumeration type defined with the following values:
public enum Progress.Open4GL.UnknownType
{    NullableType,
    HolderClass,
    None
}
The UnknownType.NullableType and UnknownType.HolderClass value both indicate that the user-defined function can return the Unknown value (?), but specify a different mechanism for returning this value when the OpenAPI return type corresponds to a supported .NET value type (System.Boolean, System.DateTime, System.Decimal, System.Int32, or System.Int64).
The specified mechanism is used when the ReturnType property is set to one of the following Progress.Open4GL.Parameter class constants, each of which maps to a supported value type:
*PRO_DATE
*PRO_DATETIME
*PRO_DATETIMETZ
*PRO_DECIMAL
*PRO_INTEGER
*PRO_INT64
*PRO_LOGICAL
*PRO_RECID
Thus, if you set UnknownReturnType to:
*UnknownType.NullableType — The function can return the Unknown value (?) and returns its value as the matching nullable type (or nullable type array) when the ReturnType property setting corresponds to a supported .NET value type (or value type array). If the ReturnType property setting corresponds to a reference type, the specified reference type is returned.
*UnknownType.HolderClass — The function can return the Unknown value (?) and returns its value as the matching OpenEdge type-holder class (or holder class array) when the ReturnType property setting corresponds to a supported .NET value type (or value type array). If the ReturnType property setting corresponds to a reference type, the specified reference type is returned.
Note: This value is provided for backward compatibility only.
*UnknownType.None — The function cannot return the Unknown value (?), which is the default. In this case, the function returns its value as the .NET value or reference type that corresponds to the ReturnType property setting.
Note: If you set the IsReturnUnknown property to TRUE, this sets UnknownReturnType to UnknownType.HolderClass. If you set IsReturnUnknown to FALSE, this sets UnknownReturnType to UnknownType.None. Note also that IsReturnUnknown is supported for backward compatibility only. For more information on the IsReturnUnknown property, see IsReturnUnknown property.
For example, if the ReturnType property represents an ABL INTEGER EXTENT and UnknownReturnType is set to:
*UnknownType.NullableType — The ReturnValue property returns a System.Int32?[].
*UnknownType.HolderClass — the ReturnValue property returns an IntHolder[].
*UnknownType.None — The ReturnValue property returns a System.Int32[].
For information on the ReturnValue property, see Accessing user-defined function return values.
For more information on the use of .NET nullable types and OpenEdge type-holder classes, see Unknown value (?) as a parameter.
If a scalar return value can be the Unknown value (?), check if the ReturnValue property is null. If it is not null, you can then unbox ReturnValue to get the value on a ParamArray object, parms, as follows:
int intRetVal = (int)parms.ReturnValue;