Variants
To define a variable that contains any type of data, you can write code that uses the variant data type. To identify the type of data that the variable currently contains, Siebel VB stores a tag with the variant data. To examine this tag, you can use the VarType function.
The following table describes the types of values that a variant can contain.
Type | Size of Data | Smallest Value | Largest Value |
---|---|---|---|
0 Empty |
0 |
Not applicable. |
Not applicable. |
1 Null |
0 |
Not applicable. |
Not applicable. |
2 Integer |
2 bytes, short |
Negative 32768. |
Positive 32767. |
3 Long |
4 bytes, long |
Negative 2.147E9. |
Positive 2.147E9. |
4 Single |
4 bytes, float |
Negative 3.402E38. |
Negative 1.401E-45. |
Positive 1.401E-45. |
Positive 3.402E38. |
||
5 Double |
8 bytes, double |
Negative 1.797E308. |
Negative 4.94E-324. |
Positive 4.94E-324. |
Positive 1.797E308. |
||
6 Currency |
8 bytes, fixed |
Negative 9.223E14. |
Positive 9.223E14. |
7 Date |
8 bytes, double |
Jan 1, 100 to Dec 31, 9999. |
Not applicable. |
8 String |
up to 2 gigabytes |
Length is limited by the amount of random access memory, up to 2 gigabytes. |
Not applicable. |
9 Object |
Not applicable. |
Not applicable. |
Not applicable. |
If you define a variant that contains no data, then Siebel VB defaults the type to Empty. It does the following:
Converts an empty variant to zero when it uses this variant in a numeric expression
Converts an empty variant to an empty string when it uses this variant in a string expression
You can use the IsEmpty statement to determine if a variant is empty. For more information, see Is Variable Set Method.
A null variant does not include data. It only represents a result that is not valid or that is ambiguous. You can use the IsNull statement to determine if a variant contains a null value. Null indicates that a variant is not set. For more information, see Is Variable Null Method.