Try OpenEdge Now
skip to main content
.NET Open Clients
Passing Parameters : ABL data type mappings : Unknown value (?) as a parameter : Using OpenEdge holder classes
 
Using OpenEdge holder classes
In ProxyGen, if you specify that a supported value type parameter or return value can have the Unknown value (?), and you have chosen to use holder classes, the method is defined with the corresponding holder class; otherwise the parameter is defined using the .NET value type.
The following is an example of a C# proxy method signature that does not support Unknown value (?) for the first and third parameters:
foo(int i, string s, bool b)
The following is an example of a C# proxy method that allows all the parameter values to have Unknown value (?), using holder classes where necessary:
foo(IntHolder i, string s, BooleanHolder b)
For each ABL data type that maps to a .NET value type, there is a Holder class. These Holder classes belong to the Progress.Open4GL namespace and extend the Progress.Open4GL.Holder class, as shown in the following table.
Table 5. Holder class definitions
Class
Constructors
Property
BooleanHolder
BooleanHolder( )
BooleanHolder(bool value)
System.Boolean
   BooleanValue;
DateHolder
DateHolder( )
DateHolder(System.DateTime value)
System.DateTime    DateValue;
DecimalHolder
DecimalHolder(decimal value)
DecimalHolder(double value)
System.Decimal    DecimalValue;
IntHolder
IntHolder( )
IntHolder(int value)
System.Int32 IntValue;
LongHolder
LongHolder( )
LongHolder(long value)
System.Int64 LongValue;
The property specified in the above table allows you to set and get a value with the .NET value type for which it is defined. These classes all contain two additional properties that allow you to set and test for null:
*Value — To which you can set or get null, which corresponds to setting or getting the Unknown value (?) for an ABL primitive type.
*isNull — A System.Boolean property that returns true if the Value property of the holder class is set to null.
The following table shows ABL primitive types that have a default .NET value-type mapping that cannot accept Unknown value (?). To accept the Unknown value (?), these ABL primitive types are mapped to holder classes in the Progress.Open4GL namespace, as shown in the table.
Table 6. ABL primitive type to holder class mappings
This ABL primitive type...
Maps to this holder class...

DATE
DATETIME
DATETIME-TZ

Progress.Open4GL.DateHolder

DECIMAL

Progress.Open4GL.DecimalHolder

INT64

Progress.Open4GL.LongHolder

INTEGER

Progress.Open4GL.IntHolder

LOGICAL

Progress.Open4GL.BooleanHolder

RECID

Progress.Open4GL.LongHolder