VARIANT
PLBCMP GUI Only
The VARIANT object is provided in a PLB program so that data requirements associated with OLE property/method parameters that do not directly translate into a PLB program data variable type can be used. To define a VARIANT, use the following statement format:
|
|
|
|
Where:
label
Optional. A Data Label.
Flags Affected: NONE
Note the following:
It is possible that a VARIANT object can be the operand of a OLE property or method parameter and the VARIANT data is never directly translated into a PLB data format. However, using CREATE, GETPROP, and SETPROP, the ability to create and manipulate the type and value associated with a VARIANT object is available.
The VARTYPE property may include a $VT_ARRAY value creating a one dimensioned VARIANT array with a single VARIANT element. The number of VARIANT elements may changed using the ResizeElements method.
The $VT_ARRAY value cannot be used for a VARTYPE value to change a variant type in a SETPROP operation. Attempts to do so will cause an O132 error to occur. A SETPROP operation to set the VARVALUE property for a VARIANT that was created using the $VT_ARRAY type will change the first variant value in the VARIANT array.
A GETPROP instruction for the VARVALUE or VARABSVALUE property of a VARIANT that was created using the $VT_ARRAY type will retrieve the first variant value in the array.
When using the PL/B Web Server, this object is created and supported as a server-side object. This object is not available nor used at the client browser.
See Also: Object Definitions, Object Output Instructions
![]() |