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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

String Functions<br />

Function Description<br />

InStr Returns the position of the first occurrence of one string within another. The search begins at the<br />

first character of the string<br />

InStrRev Returns the position of the first occurrence of one string within another. The search begins at the<br />

last character of the string<br />

LCase Converts a specified string to lowercase<br />

Left Returns a specified number of characters from the left side of a string<br />

Len Returns the number of characters in a string<br />

LTrim Removes spaces on the left side of a string<br />

Mid Returns a specified number of characters from a string<br />

Replace Replaces a specified part of a string with another string a specified number of times<br />

Right Returns a specified number of characters from the right side of a string<br />

RTrim Removes spaces on the right side of a string<br />

Space Returns a string that consists of a specified number of spaces<br />

StrComp Compares two strings and returns a value that represents the result of the comparison<br />

String Returns a string that contains a repeating character of a specified length<br />

StrReverse Reverses a string<br />

Trim Removes spaces on both the left and the right side of a string<br />

UCase Converts a specified string to uppercase<br />

Variant Identification Functions<br />

Variant<br />

Function<br />

Description<br />

IsArray<br />

IsDate<br />

IsEmpty<br />

IsNull<br />

IsNumeric<br />

Returns a Boolean value indicating whether a variable is an array<br />

Returns a Boolean value indicating whether an expression can be converted to a date<br />

Returns a Boolean value indicating whether a variable has been initialized.<br />

Returns a Boolean value that indicates whether an expression contains no valid data (Null).<br />

Returns a Boolean value indicating whether an expression can be evaluated as a number<br />

IsObject Returns a Boolean value indicating whether an expression refers to a valid Automation<br />

object.<br />

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

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

Statements<br />

<strong>VBScript</strong> statements are used to per<strong>for</strong>m fundamental operations such as decision making, repetition<br />

(looping) and assignments. Statements combined with Operators are the building blocks <strong>for</strong> more<br />

complex code.<br />

Multiple statements can appear on the same line as long as they are separated by a colon (:). For<br />

purposes of code readability, it is recommended to use one statement per line.<br />

Assignment Statements<br />

Many of <strong>VBScript</strong>s assignment statements have already been covered. For consistency purposes, they<br />

are listed here. Please refer to the Appendix <strong>for</strong> a more detailed description of their use.<br />

Assignment Statements<br />

Statement Description<br />

Const Declares constants <strong>for</strong> use in place of literal values<br />

Dim Declares variables and allocates storage space<br />

Erase Reinitializes the elements of fixed-size arrays, deallocates dynamic-array storage space.<br />

Option Explicit Forces explicit declaration of all variables in the script<br />

Private Declares private variables and allocates storage space<br />

Public Declares public variables and allocates storage space<br />

ReDim Declare dynamic array variables, allocates or reallocates storage space at procedural level<br />

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

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

Saved successfully!

Ooh no, something went wrong!