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

Exp<br />

Description Returns e (the base of natural logarithms) raised to a power<br />

Usage realVal = Exp(number)<br />

Arguments number<br />

The number argument can be any valid numeric expression<br />

Return Returns a Variant subtype Double<br />

Remarks If the value of number exceeds 709.782712893, a runtime error occurs. The constant e is<br />

approximately 2.718282. The Exp function complements the action of the Log function and is<br />

sometimes referred to as the antilogarithm.<br />

See also Log<br />

Example Dim MyAngle, MyHSin<br />

MyAngle = 1.3 'Define angle in radians.<br />

MyHSin = (Exp(MyAngle) - Exp(-1 * MyAngle)) / 2 'Calculate hyperbolic sine. Result<br />

1.69838<br />

Filter<br />

Description Returns a zero-based array containing a subset of a string array based on a specified filter criteria<br />

Usage strArray = Filter(InputStrings, Value[, Include[, Compare]])<br />

Arguments InputStrings<br />

Required. One-dimensional array of strings to be searched.<br />

Value<br />

Required. String to search <strong>for</strong>.<br />

Include<br />

Optional. Boolean value indicating whether to return substrings that include or exclude Value.<br />

If Include is True, Filter returns the subset of the array that contains Value as a substring. If<br />

Include is False, Filter returns the subset of the array that does not contain Value as a<br />

substring. Default is True<br />

Compare<br />

Optional. Numeric value indicating the kind of string comparison to use. See Settings section<br />

<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 string array<br />

Remarks If no matches of Value are found within InputStrings, Filter returns an empty array. An error<br />

occurs if InputString is Null or is not a one-dimensional array. The array returned by the Filter<br />

function contains only enough elements to contain the number of matched items. You can use the<br />

Ubound function to determine the size of the zero-based array returned.<br />

Example The following example uses the Filter function to return the array containing the search criteria<br />

"Mon":<br />

Dim MyIndex<br />

Dim MyArray (3)<br />

MyArray(0) = "Sunday"<br />

MyArray(1) = "Monday"<br />

MyArray(2) = "Tuesday"<br />

MyIndex = Filter(MyArray, "Mon") 'MyIndex(0) contains "Monday".<br />

MyIndex = Filter(MyArray, “n”) ‘MyIndex(0) contains “Sunday”<br />

‘MyIndex(1) contains “Monday”<br />

MyIndex = Filter(MyArray, “n”, False) ‘MyIndex(0) contains “Tuesday”<br />

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

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

Saved successfully!

Ooh no, something went wrong!