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

Or Operator (Or, |)<br />

Description Per<strong>for</strong>ms a logical disjunction on two expressions.<br />

Usage result = expression1 Or expression2<br />

Arguments result<br />

Any variable.<br />

expression1<br />

Any valid expression.<br />

expression2<br />

Any valid expression.<br />

Remarks If either or both expressions evaluate to True, result is True. The following table illustrates how<br />

result is determined:<br />

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

True True True<br />

True False True<br />

True Null True<br />

False True True<br />

False False False<br />

False Null Null<br />

Null True True<br />

Null False Null<br />

Null Null Null<br />

The Or operator also 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 0<br />

0 1 1<br />

1 0 1<br />

1 1 1<br />

See also AND Operator, NOR Operator, XOR Operator<br />

Example: Dim alarm1, alarm2<br />

Dim alarm_light<br />

If ( (alarm1 = True) Or (alarm2 = True)) then<br />

alarm_light = True<br />

Else<br />

alarm_light = False<br />

End If<br />

Example a = 5 ‘ a = 5 (bitwise 0000 0000 0000 0101)<br />

b = 4 ‘ b = 4 (bitwise 0000 0000 0000 0100)<br />

MyResult = a Or b ‘ Result = 5<br />

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

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

Saved successfully!

Ooh no, something went wrong!