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>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> <strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong><br />

LBound<br />

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

Usage intVal = LBound(arrayname[, dimension])<br />

Arguments arrayname<br />

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

dimension<br />

Whole number (integer) indicating which dimension's lower bound is returned. Use 1 <strong>for</strong> the<br />

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

Return An Integer representing the smallest subscript <strong>for</strong> an array, which in <strong>VBScript</strong> is always 0 since<br />

<strong>VBScript</strong> arrays are zero-based. Return value will be a Variant subtype Long..<br />

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

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

dimension is always 0 in <strong>VBScript</strong>. LBound will raise a runtime error if the array has not been<br />

initialized.<br />

See also Dim, ReDim, UBound<br />

Example Dim MyArray(3)<br />

MsgBox LBound(MyArray) ‘ Displays 0<br />

LCase<br />

Function Converts all alpha characters in a string to lowercase.<br />

Usage strVal = LCase(string)<br />

Arguments string<br />

Any valid string expression..<br />

Remarks If string contains Null, Null is returned. Only uppercase letters are converted to lowercase; all<br />

lowercase letters and non-letter characters remain unchanged.<br />

Return A String.<br />

See Also UCase<br />

Example The following example uses the LCase function to convert uppercase letters to lowercase:<br />

Dim MyString<br />

Dim LCaseString<br />

MyString = "VBSCript"<br />

LCaseString = LCase(MyString) ' LCaseString contains "vbscript".<br />

Left<br />

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

Usage strVal = Left(string, length)<br />

Arguments string<br />

String expression from which the leftmost characters are returned.<br />

length<br />

Numeric expression indicating how many characters to return.<br />

Return A String.<br />

Remarks If string contains Null, Null is returned. If length = 0, a zero-length string("") is returned. If length is<br />

greater than or equal to the number of characters in string, the entire string is returned. To<br />

determine the number of characters in string, use the Len function.<br />

See Also LeftB, Len, LenB, LTrim, Mid, MidB, Right, RTrim, Trim<br />

Example Dim myStr, extStr<br />

myStr = “UpAndDown”<br />

extStr = Left(myStr, 2) ‘Returns “Up”<br />

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

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

Saved successfully!

Ooh no, something went wrong!