Unions
Unions are classes containing potentially several different value types. Every union has a discriminator property with the predefined name, discr. This property returns a value identifying the type of data that the union object holds. For each union member, a separate property is used to access the different data types. It is illegal to attempt to read any property except the one that matches the value returned from the discriminator. However, any property that switches the discriminator to the new value type can be modified.
The following is an example of a VB API union:
Interface IpfcParamValue
--------------------------------------------------------
Description
This class describes the value of the parameter.
--------------------------------------------------------
Union Discriminant
Property discr as IpfcParamValueType [readonly]
Returns the union discriminant value.
--------------------------------------------------------
Property Summary
Property BoolValue as Boolean
If the parameter type is PARAM_BOOLEAN, this is a Boolean value.
Property DoubleValue as Double
If the parameter type is PARAM_DOUBLE, this is a double value.
Property IntValue as Long
If the parameter type is PARAM_INTEGER, this is an integer value.
Property NoteId as Long
If the parameter type is PARAM_NOTE, this is a note identifier.
Property StringValue as String
If the parameter type is PARAM_STRING, this is a string value.