18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overview of VBScript<br />

operator. It does not compare objects or their values; it checks only to determine if two object references refer<br />

to the same object.<br />

Logical Operator NOT<br />

The logical operator NOT behaves differently in VBScript than it does in the built-in scripting language.<br />

NOT Operator in VBScript<br />

In VBScript, the NOT operator inverts the bits of a given numeric value, producing its complement number<br />

according to the "two's complement" system of signed numbers that is used by computers. The table below<br />

illustrates the behavior of the NOT operator in VBScript for the syntax…<br />

result = NOT expression<br />

If expression is…<br />

Then result is…<br />

−3 2<br />

−2 1<br />

−1 0<br />

0 −1<br />

1 −2<br />

2 −3<br />

3 −4<br />

Note: By default, when you attempt to write any numeric value other than 0 to a Boolean tag, the<br />

tag automatically assumes a value of 1. Therefore, if VBScript's NOT operator is applied to a Boolean<br />

tag with a value of 1, then the value of the tag does not change; the operator returns a value of −2,<br />

but the tag cannot accept this value so it again assumes a value of 1.<br />

You can configure IWS to treat Boolean tags like Boolean variables in VBScript, so that the NOT<br />

operator in VBScript will work as expected. For more information, please see Boolean Tags and<br />

Boolean Variables.<br />

NOT Operator in Built-in Language<br />

In contrast, the NOT operator in the Built-in Scripting Language toggles the given numeric value as if it<br />

is a natural boolean. The table below illustrates the behavior of the NOT operator in the Built-in Scripting<br />

Language for the syntax…<br />

result = NOT expression<br />

If expression is…<br />

Then result is…<br />

0 1<br />

≠0 0<br />

Using Conditional Statements<br />

You can control the flow of your script with conditional statements and looping statements. Using conditional<br />

statements, you can write VBScript code that makes decisions and repeats actions. The following conditional<br />

statements are available in VBScript:<br />

• If…Then…Else statement<br />

• Select Case statement<br />

Page 790<br />

<strong>InduSoft</strong> Web Studio

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

Saved successfully!

Ooh no, something went wrong!