Microsoft® Visual Basic® Scripting Edition
VarType Function
| Language Reference 
| Home | Site Map |

 
See Also
Description
Returns a value indicating the subtype of a variable.

Syntax

VarType(varname)

The varname argument can be any variable.

Return Values

Value Variable type description
0 Empty (uninitialized).
1 Null (no valid data).
2 Integer.
3 Long integer.
4 Single-precision floating-point number.
5 Double-precision floating-point number.
6 Currency.
7 Date.
8 String.
9 Automation object.
10 Error.
11 Boolean.
12 Variant (used only with arrays of Variants).
13 Non-Automation object.
17 Byte
8192 Array.

Remarks

The VarType function never returns the value for Array by itself. It is always added to some other value to indicate an array of a particular type. The value for Variant is only returned when it has been added to the value for Array to indicate that the argument to the VarType function is an array. For example, the value returned for an array of integers is calculated as 2 + 8192, or 8194. If an object has a default property, VarType (object) returns the type of its default property.


© 1996 by Microsoft Corporation.