VBScript Reference Manual for InduSoft Web Studio
VBScript Reference Manual for InduSoft Web Studio
VBScript Reference Manual for InduSoft Web Studio
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 />
Literal Keywords used with Boolean data subtypes<br />
Keyword Description<br />
False Boolean condition that is not correct (false has a value of 0)<br />
True Boolean condition that is correct (true has a value of -1)<br />
An example would be:<br />
Dim overtemp_condition<br />
If $temperature > 100 then<br />
overtemp_condtion = True<br />
Else<br />
Overtemp_condition = False<br />
End If<br />
There are several logical operators available in <strong>VBScript</strong> that can be used to evaluate logical<br />
expressions. These logical operators can be used with both Boolean data subtypes as well as in<br />
Comparison expressions. In the table below, a and b are assumed to represent logical expressions.<br />
Logical Operators<br />
Logic Operator Example Returns<br />
AND And a AND b True only if a and b are both true<br />
OR Or, | a OR b True if a or b is true, or both are true<br />
Exclusive OR Xor a Xor b True if a or b is true, but not both<br />
Equivalence Eqv a Eqv b True if a and b are the same<br />
Implication Imp a Imp b False only if a is true and b is false otherwise<br />
true<br />
NOT Not a Not b True if a is false; False if a is true<br />
A couple examples of the logical operators are:<br />
Dim temp, pressure<br />
If (temp > 212) And (pressure > 1) then ‘ evaluate a conditional expression<br />
Call Alarm_routine<br />
End If<br />
Dim a, b, temp, pressure<br />
a = (temp > 212) And (pressure > 1) ‘ conditional expression stored as a boolean<br />
If a = True Then ‘ logical condition test<br />
Call Alarm_routine<br />
End If<br />
Note that the | operator (shift \) can be used instead of the Or logical operator. The statements (a | b)<br />
and (a Or b) are equivalent.<br />
Logical Truth Table<br />
a b a And b a Or b a Xor b a Eqv b a Imp b Not a<br />
T T T T F T T F<br />
T F F T T F F F<br />
F T F T T F T T<br />
F F F F F T T T<br />
68 <strong>InduSoft</strong>, Ltd.