18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

VarType<br />

Description Returns a value indicating the subtype of a variable.<br />

Usage VarType(varname)<br />

Arguments varname<br />

The required varname argument can be any variable.<br />

Return An Integer. The VarType function returns the following values<br />

Constant Value Description<br />

vbEmpty 0 Empty (uninitialized)<br />

vbNull 1 Null (no valid data)<br />

vbInteger 2 Integer<br />

vbLong 3 Long integer<br />

vbSingle 4 Single-precision floating-point number<br />

vbDouble 5 Double-precision floating-point number<br />

vbCurrency 6 Currency<br />

vbDate 7 Date<br />

vbString 8 String<br />

vbObject 9 Automation object<br />

vbError 10 Error<br />

vbBoolean 11 Boolean<br />

vbVariant 12 Variant (used only with arrays of Variants)<br />

vbDataObject 13 A data-access object<br />

vbByte 17 Byte<br />

vbArray 8192 Array<br />

Remarks These constants are specified by <strong>VBScript</strong>. As a result, the names can be used anywhere in your<br />

code in place of the actual values.<br />

The VarType function never returns the value <strong>for</strong> Array by itself. It is always added to some other<br />

value to indicate an array of a particular type. The value <strong>for</strong> Variant is only returned when it has<br />

been added to the value <strong>for</strong> Array to indicate that the argument to the VarType function is an<br />

array. For example, the value returned <strong>for</strong> an array of integers is calculated as 2 + 8192, or 8194.<br />

If an object has a default property, VarType (object) returns the type of its default property.<br />

See Also IsArray, IsDate, IsEmpty, IsNull, IsNumeric, IsObject, TypeName<br />

Example The following example uses the VarType function to determine the subtype of a variable.<br />

Dim MyCheck<br />

MyCheck = VarType(300) ' Returns 2.<br />

MyCheck = VarType(#10/19/62#) ' Returns 7.<br />

MyCheck = VarType("<strong>VBScript</strong>") ' Returns 8.<br />

166 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!