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 />

TypeName<br />

Description Returns a string that provides Variant subtype in<strong>for</strong>mation about a variable.<br />

Usage TypeName(varname)<br />

Arguments varname<br />

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

Return A String. The TypeName function has the following return values:<br />

Value Description<br />

Byte Byte value<br />

Integer Integer value<br />

Long Long integer value<br />

Single Single-precision floating-point value<br />

Double Double-precision floating-point value<br />

Currency Currency value<br />

Decimal Decimal value<br />

Date Date or time value<br />

String Character string value<br />

Boolean Boolean value; True or False<br />

Empty Uninitialized<br />

Null No valid data<br />

Actual type name of an object<br />

Object Generic object<br />

Unknown Unknown object type<br />

Nothing Object variable that doesn't yet refer to an object instance<br />

Error Error<br />

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

Example The following example uses the TypeName function to return in<strong>for</strong>mation about a variable:<br />

Dim ArrayVar(4), MyType<br />

NullVar = Null ' Assign Null value.<br />

MyType = TypeName("<strong>VBScript</strong>") ' Returns "String".<br />

MyType = TypeName(4) ' Returns "Integer".<br />

MyType = TypeName(37.50) ' Returns "Double".<br />

MyType = TypeName(NullVar) ' Returns "Null".<br />

MyType = TypeName(ArrayVar) ' Returns "Variant()".<br />

UBound<br />

Description Returns the largest available subscript <strong>for</strong> the indicated dimension of an array.<br />

Usage IntVal = UBound(arrayname[, dimension])<br />

Arguments arrayname<br />

Name of the array variable; follows standard variable naming conventions.<br />

dimension<br />

Optional whole (integer) number indicating which dimension's upper bound is returned. Use 1<br />

<strong>for</strong> the first dimension, 2 <strong>for</strong> the second, and so on. If dimension is omitted, 1 is assumed.<br />

Returns Returns the largest available subscript <strong>for</strong> the indicated dimension of an array. If the array is<br />

empty, -1 is returned. If the array has not been initialized, a runtime error will occur.<br />

Remarks The UBound function is used with the LBound function to determine the size of an array. Use<br />

the LBound function to find the lower limit of an array dimension. The lower bound <strong>for</strong> any<br />

dimension is always 0.<br />

See also Dim, LBound, ReDim<br />

Example Dim A(100,3,4)<br />

Dim B(3)<br />

myVal = UBound(A,1) ‘ Return value = 100<br />

myVal = UBound(A,2) ‘ Return value = 3<br />

myVal = UBound(A,3) ‘ Return value = 4<br />

myVal = UBound(B) ‘ Return value = 3<br />

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

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

Saved successfully!

Ooh no, something went wrong!