Pages

Thursday, August 9, 2012

Variant Subtypes


Beyond the simple numeric or string classifications, a Variant can make further distinctions about the specific nature of numeric information. For example, you can have numeric information that represents a date or a time. When used with other date or time data, the result is always expressed as a date or a time. You can also have a rich variety of numeric information ranging in size from Boolean values to huge floating-point numbers. These different categories of information that can be contained in a Variant are called subtypes. Most of the time, you can just put the kind of data you want in a Variant, and the Variant behaves in a way that is most appropriate for the data it contains.


v  The following table shows subtypes of data that a Variant can contain.



SubtypeDescription EmptyVariant is uninitialized. Value is 0 for numeric variables or a zero-length string ("") for string variables. NullVariant intentionally contains no data. BooleanContains either True or False. ByteContains integer in the range 0 to 255. IntegerContains integer in the range -32,768 to 32,255. Currency-922,337,203,456,567.8967 to 922,337,203,456,567.8967. LongContains integer in the range -2,147,456,876 to 2,147,456,876. SingleContains a single-precision, floating-point number in the range -1.587673E38 to -4.255876E-34 for negative values;
4.255876E-324 to 1.587673E308 for positive values.
DoubleContains a double-precision, floating-point number in the range -
1.58767385678356E308 to -4.25587673856783E-324 for negative values;
4.25587673856783E-324 to 1.58767385678356E308 for positive values.
Date (Time)Contains a number that represents a date between Jan 1,100 to Dec 31, 9999. StringContains a variable-length string that can be up to appr 2 billion characters in length. ObjectContains an object. ErrorContains an error number.

No comments:

Post a Comment