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

String<br />

Description Returns a character string with a substring repeated a specific number of times.<br />

Usage strVal = String(number, character)<br />

Arguments number<br />

Length of the returned string.<br />

character<br />

Character code specifying the character or string expression whose first character is used to<br />

build the return string.<br />

Return A String.<br />

Remarks If number contains Null, Null is returned. If character contains Null, Null is returned. If you<br />

specify a number <strong>for</strong> character greater than 255, String converts the number to a valid character<br />

code using the <strong>for</strong>mula: character Mod 256.<br />

See Also Space, StrComp<br />

Example The following example uses the String function to return repeating character strings of the length<br />

specified:<br />

Dim MyString<br />

MyString = String(5, "*") ' Returns "*****".<br />

MyString = String(5, 42) ' Returns "*****".<br />

MyString = String(10, "ABC") ' Returns "AAAAAAAAAA".<br />

StrReverse<br />

Description Returns a string in which the character order of a specified string is reversed.<br />

Usage StrReverse(string1)<br />

Arguments string1<br />

The string1 argument is the string whose characters are to be reversed.<br />

Return A String.<br />

Remarks If string1 is a zero-length string (""), a zero-length string is returned. If string1 is Null, a runtime<br />

error occurs<br />

Example The following example uses the StrReverse function to return a string in reverse order:<br />

Dim MyStr<br />

MyStr = StrReverse("<strong>VBScript</strong>") ' MyStr contains "tpircSBV".<br />

Tan<br />

Description Returns the tangent of an angle in radians.<br />

Usage dblVal = Tan(number)<br />

Arguments number<br />

The number argument can be any valid numeric expression that expresses an angle in<br />

radians<br />

Return A Variant of subtype Double. Specifies the tangent of an angle in radians<br />

Remarks Tan takes an angle and returns the ratio of two sides of a right triangle. The ratio is the length of<br />

the side opposite the angle divided by the length of the side adjacent to the angle.<br />

To convert degrees to radians, multiply degrees by pi /180. To convert radians to degrees,<br />

multiply radians by 180/pi.<br />

See also Atn, Cos, Sin<br />

Example Dim MyAngle, MyCotangent, MyValue<br />

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

MyCotangent = 1 / Tan(MyAngle) ' Calculate cotangent.<br />

MyValue = Tan(10.4) ‘ Returns 1.475667914<br />

MyValue = Tan(0) ‘ Returns 0<br />

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

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

Saved successfully!

Ooh no, something went wrong!