Siebel VB Language Reference > Language Overview >

Variant Data Type


The variant data type can be used to define variables that contain any type of data. A tag is stored with the variant data to identify the type of data that it currently contains. You can examine the tag by using the VarType function.

A variant can contain a value of any of the types listed in Table 7.

Table 7.  Variant Value Types
Type/Name
Size of Data
Range
0  (Empty)
0
N/A
1  Null
0
N/A
2  Integer
2 bytes (short)
-32768 to 32767
3  Long
4 bytes (long)
-2.147E9 to 2.147E9
4  Single
4 bytes (float)
-3.402E38 to -1.401E-45 (negative)
1.401E-45 to 3.402E38 (positive)
5  Double
8 bytes (double)
-1.797E308 to -4.94E-324 (negative)
4.94E-324 to 1.797E308 (positive)
6  Currency
8 bytes (fixed)
-9.223E14 to 9.223E14
7  Date
8 bytes (double)
Jan 1st, 100 to Dec 31st, 9999
8  String
up to 2GB
Length is limited by the amount of random access memory, up to 2 GB
9  Object
N/A
N/A

A newly defined Variant defaults to being of Empty type to signify that it contains no initialized data. An Empty Variant is converted to zero when used in a numeric expression, or to an empty string when used in a string expression. To test whether a variant is uninitialized (empty), use the IsEmpty function.

Null variants have no associated data and serve only to represent invalid or ambiguous results. You can test whether a variant contains a null value with the IsNull function. Null is not the same as Empty, which indicates that a variant has not yet been initialized.


 Siebel VB Language Reference
 Published: 18 June 2003