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() Function<br />

TypeName is a read-only function that identifies the data subtype and returns a string that<br />

contains the data subtype. This string can then be used in a flow control statement, or in a<br />

message.<br />

Return values from TypeName function<br />

Return Value Description<br />

Actual Type name of an Object<br />

Boolean Boolean value (True or False)<br />

Byte Byte value<br />

Currency Currency value<br />

Date Date or Time value<br />

Decimal Decimal value<br />

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

Empty Uninitialized<br />

Error Error<br />

Integer Integer value<br />

Long Long integer value<br />

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

Null No valid data<br />

Object Generic object<br />

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

String Character string value<br />

Variant() Variant Array<br />

Unknown Unknown object type<br />

Dim MyVal<br />

Dim a(9)<br />

MsgBox TypeName(MyVal) ‘ Will get message “Empty”<br />

MyVal = 5.2<br />

MsgBox TypeName(MyVal) ‘ Will get message “Double”<br />

Msgbox Typename(a) ‘ Will get message Variant()”<br />

Key Notes:<br />

1. When you pass an Array argument to the TypeName function, it will return value of<br />

Variant(). This return value is not listed in Microsoft’s official documentation. Since<br />

<strong>VBScript</strong> does not support data typing, there is no way to determine the data type of the<br />

array. Instead, you must determine the data type of each element in the array, one<br />

element at a time.<br />

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

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

Saved successfully!

Ooh no, something went wrong!