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

Space<br />

Description Returns a string consisting of the specified number of spaces (“ “).<br />

Usage strVal = Space(number)<br />

Arguments number<br />

The number argument is the number of spaces you want in the string.<br />

Return A String.<br />

Remarks None<br />

See Also String<br />

Example The following example uses the Space function to return a string consisting of a specified number<br />

of spaces<br />

Dim MyString<br />

MyString = Space(10) ' Returns a string with 10 spaces.<br />

MyString = "Hello" & Space(10) & "World" ' Insert 10 spaces between two strings.<br />

Split<br />

Description Returns a zero-based, one-dimensional array extracted from the supplied string expression.<br />

Usage strVal = Split(expression[, delimiter[, count[, compare]]])<br />

Arguments expression<br />

Required. String expression containing substrings and delimiters.<br />

delimiter<br />

Optional. String character used to identify substring limits.<br />

count<br />

Optional. Number of substrings to be returned; -1 indicates that all substrings are returned.<br />

compare<br />

Optional. Numeric value indicating the kind of comparison to use when evaluating substrings.<br />

See Settings section <strong>for</strong> values.<br />

Settings The compare argument can have the following values:<br />

Constant Value Description<br />

vbBinaryCompare 0 Per<strong>for</strong>m a binary comparison.<br />

vbTextCompare 1 Per<strong>for</strong>m a textual comparison<br />

Return A zero-based, one-dimensional array string.<br />

Remarks If expression is a zero-length string, Split returns an empty array, that is, an array with no<br />

elements and no data. If delimiter is omitted, the space character (" ") is assumed to be the<br />

delimiter. If delimiter is a zero-length string, a single-element array containing the entire<br />

expression string is returned. The result of the Split function cannot be assigned to a variable of<br />

Variant subtype Array, otherwise a runtime error will occur.<br />

See Also Join<br />

Example The following example uses the Split function to return an array from a string. The function<br />

per<strong>for</strong>ms a textual comparison of the delimiter, and returns all of the substrings<br />

Dim MyString, MyArray, Msg<br />

MyString = "<strong>VBScript</strong>XisXfun!"<br />

MyArray = Split(MyString, "x", -1, 1)<br />

' MyArray(0) contains "<strong>VBScript</strong>".<br />

' MyArray(1) contains "is".<br />

' MyArray(2) contains "fun!".<br />

Msg = MyArray(0) & " " & MyArray(1)<br />

Msg = Msg & " " & MyArray(2)<br />

MsgBox Msg<br />

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

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

Saved successfully!

Ooh no, something went wrong!