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

Exponentiation Operator (^)<br />

Description Raises a number to the power of an exponent<br />

Usage result = number ^ exponent<br />

Arguments result<br />

Any numeric variable.<br />

number<br />

Any valid numeric expression<br />

exponent<br />

Any valid numeric expression.<br />

Remarks number can be negative only if exponent is an integer value. When more than one exponentiation<br />

is per<strong>for</strong>med in a single expression, the ^ operator is evaluated as it is encountered from left to<br />

right. If either number or exponent is a Null expression, result is also Null.<br />

Example: Dim a<br />

a = 2<br />

a = a ^ 2 ‘ a now equal 4<br />

a = 5 ^ 5 ‘ a is now 3,125<br />

Imp Operator (Imp)<br />

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

Usage result = expression1 Imp expression2<br />

Arguments result<br />

Any variable.<br />

expression1<br />

Any expression.<br />

expression2<br />

Any expression<br />

Remarks The following table illustrates how result is determined:<br />

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

True True True<br />

True False False<br />

True Null Null<br />

False True True<br />

False False True<br />

False Null True<br />

Null True True<br />

Null False Null<br />

Null Null Null<br />

The Imp 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 1<br />

1 0 0<br />

1 1 1<br />

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

cond1 = True<br />

cond2 = Null<br />

cond3 = cond1 Imp cond2 ‘ cond3 is set to Null<br />

Example MyResult = 0 Imp 0 ‘ Returns 1<br />

MyResult = 1 Imp 0 ‘ Returns 0<br />

MyResult = 1 Imp 1 ‘ Returns 1<br />

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

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

Saved successfully!

Ooh no, something went wrong!