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

Atn<br />

Description Returns the arctangent of a number<br />

Usage realRslt = Atn(number)<br />

Arguments number<br />

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

Return Returns the arctangent of a number as Variant subtype Double. Result is in radians.<br />

Remarks The Atn function takes the ratio of two sides of a right triangle (number) and returns the<br />

corresponding angle in radians. The ratio is the length of the side opposite the angle divided by<br />

the length of the side adjacent to the angle. The range of the result is -pi /2 to pi/2 radians. To<br />

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

radians by 180/pi.<br />

Note: Atn is the inverse trigonometric function of Tan, which takes an angle as its argument and<br />

returns the ratio of two sides of a right triangle. Atn is not to be confused with the cotangent,<br />

which is the simple inverse of a tangent (1/tangent).<br />

See also Cos, Sin, and Tan<br />

Example Dim pi<br />

pi = 4 * Atn(1) ' Calculate the value of pi.<br />

CBool<br />

Description Returns an expression that has been converted to a Variant of subtype Boolean<br />

Usage boolRslt = CBool(expression)<br />

Arguments expression<br />

Any valid expression<br />

Return Boolean value corresponding to the value of the expression<br />

Remarks If the expression is zero, False is returned; otherwise True is returned. If the expression cannot<br />

be interpreted as a numeric value, a run-time error occurs.<br />

See also CByte, CCur, CDbl, CInt, CLng, CSng, CStr<br />

Example Dim A, B, Check<br />

A = 5<br />

B= 5<br />

Check = CBool (A = B) ‘ Check contains True<br />

A= 0<br />

Check = CBool (A) ‘ Check contains False<br />

CByte<br />

Description Returns an expression that has been converted to a Variant of subtype Byte<br />

Usage byteVal = CByte (expression)<br />

Arguments expression<br />

The expression argument is any valid numeric expression<br />

Return An expression converted to a Byte value<br />

Remarks A runtime error occurs if expression can’t be evaluated to a numeric value. If expression lies<br />

outside the acceptable range <strong>for</strong> the byte subtype (0-255), an Overflow error occurs. If expression<br />

is a floating point number, it is rounded to the nearest integer and then converted to byte subtype.<br />

Use the CByte function to provide internationally aware conversions from any other data type to a<br />

Byte subtype. For example, different decimal separators are properly recognized depending on<br />

the locale setting of your system, as are different thousand separators.<br />

See also CBool, CCur, CDbl, CInt, CLng, CSng, CStr<br />

Example Dim myDouble, myByte<br />

myDouble = 123.45678<br />

myByte = CByte(myDouble) ‘ myByte contains 123<br />

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

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

Saved successfully!

Ooh no, something went wrong!