|
|
|
NOTE: This Design document is subject to change at any time. |
A Variant or OLEVariant is a data type that can hold any other data type. This is the generic data type used in untyped languages such as Visual Basic Script. It is convenient for some properties or methods where different data types might achieve different effects. For example, when adding an object to a Collection object, if you add a WideString value, the collection can automatically perform some functions such as searching. But since the Add method of the Collection can take a Variant type, you can also pass a full COM Object to the Add method and store any mixed set of objects in a Collection, making it an extremely flexible data structure.
Automatic type conversion is typically used with Variant objects. For example, if you store a number in a Variant data object and then try to append this to a String value, the number will be automatically converted to a string and then appended. If the automatic type conversion fails, you will typically get a runtime error, so you should use the conversion routines in the zApp Core module for performing conversions such as String to Integer that might result in an error.
A Variant data type can also store an array, known as a Variant array. This is compatible with the array type in Visual Basic Script. |
|