UnknownReturnType property
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
UnknownReturnType property
Syntax
This property allows you to specify if and
how the user-defined function can return the ABL Unknown value (?).
This is the syntax:
|
Progress.Open4GL.UnknownType is
an enumeration type defined with the following values:
|
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 theUnknown value (?)and returns its value as the matching nullable type (or nullable type array) when theReturnTypeproperty setting corresponds to a supported .NET value type (or value type array). If theReturnTypeproperty setting corresponds to a reference type, the specified reference type is returned. -
UnknownType.HolderClass— The function can return theUnknown value (?)and returns its value as the matching OpenEdge type-holder class (or holder class array) when theReturnTypeproperty setting corresponds to a supported .NET value type (or value type array). If theReturnTypeproperty 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 theUnknown value (?), which is the default. In this case, the function returns its value as the .NET value or reference type that corresponds to theReturnTypeproperty setting.Note: If you set theIsReturnUnknownproperty toTRUE, this setsUnknownReturnTypetoUnknownType.HolderClass. If you setIsReturnUnknowntoFALSE, this setsUnknownReturnTypetoUnknownType.None. Note also thatIsReturnUnknownis supported for backward compatibility only. For more information on theIsReturnUnknownproperty, see IsReturnUnknown property.
For example, if the ReturnType property
represents an ABL INTEGER EXTENT and UnknownReturnType is
set to:
-
UnknownType.NullableType— TheReturnValueproperty returns aSystem.Int32?[]. -
UnknownType.HolderClass— theReturnValueproperty returns anIntHolder[]. -
UnknownType.None— TheReturnValueproperty returns aSystem.Int32[].
For
information on the ReturnValue property, see Access 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:
|