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

Division Operator (/)<br />

Description Divides two numbers and returns a floating-point result<br />

Usage result = number1 / number2<br />

Arguments result<br />

Any numeric variable.<br />

number1<br />

Any valid numeric expression.<br />

number2<br />

Any valid numeric expression.<br />

Return A floating point number.<br />

Remarks If one or both expressions are Null expressions, result is Null. Any expression that is Empty is<br />

treated as 0.<br />

See also Multiplication Operator(*), Integer Division Operator(\)<br />

Example: Dim a, b<br />

a = 3<br />

b = A / 2 ‘ The result b is equal to 1.5<br />

Eqv Operator (Eqv)<br />

Description Per<strong>for</strong>ms a logical equivalence on two expressions, checking if both expressions evaluate to the<br />

same value<br />

Usage result = expression1 Eqv expression2<br />

Arguments result<br />

Any numeric variable.<br />

expression1<br />

Any expression, must evaluate to True, False, or Null<br />

expression2<br />

Any expression, must evaluate to True, False, or Null<br />

Return Returns True is both expressions evaluate to the same value (True or False)<br />

Remarks If either expression is Null, result is also Null. When neither expression is Null, result is<br />

determined according to the following table:<br />

If expression1 is And expression2 is Then result is<br />

True True True<br />

True False False<br />

False True False<br />

False False True<br />

The Eqv operator per<strong>for</strong>ms a bitwise comparison of identically positioned bits in two numeric<br />

expressions and sets the corresponding bit in result according to the following table:<br />

If bit in expression1 is And bit in expression2 is Then result is<br />

0 0 1<br />

0 1 0<br />

1 0 0<br />

1 1 1<br />

Example: Dim cond1, cond2, cond3<br />

cond1 = False<br />

cond2 = False<br />

cond3 = cond1 Eqv cond2 ‘ cond3 is set to True<br />

Example a = 5 ‘ Bitwise 5= 0000 0000 0000 0101<br />

b = 4 ‘ Bitwise 4 = 0000 0000 0000 0100<br />

MyResult = a Eqv b ‘ Result = -2 = 1111 1111 1111 1110<br />

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

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

Saved successfully!

Ooh no, something went wrong!