Operators

 

Windows Interface Language operators take one operand ("unary operators") or two operands ("binary operators").

 

§         Precedence and evaluation order

§         WIL Language Elements

§         Reference

§         Step by step guide to learning WIL

§         Notes

 

 

 

Unary operators (integers and floating point numbers)

-

Arithmetic Negation (Two's complement)

+

Identity (Unary plus)

 

Unary operators (integers only)

~

Bitwise Not. Changes each 0 bit to 1, and vice-versa.

!

Logical Not. Produces 0 (@FALSE) if the operand is nonzero, else 1(@TRUE) if the operand is zero.

 

Unary operators (variable reference)

&

Creates a pointer.

*

References variable via a pointer.

 

Binary logical operators (integers only)

<<

Left Shift

>>

Right Shift

&

Bitwise And

|

Bitwise Or

^

Bitwise Exclusive Or (XOR)

&&

Logical And

||

Logical Or

 

; If statement using Logical AND operator

If x>0 && x<=10

   Pause( 'Result', x : ' is between 1 and 10' )

Else

   Pause( 'Result', x : ' is NOT between 1 and 10' )

EndIf

 

Binary arithmetic operators (integers and floating point numbers)

**

Exponentiation

*

Multiplication

/

Division

mod

Modulo

+

Addition

-

Subtraction

 

 

 

Binary string operators

:

Concatenation

 

Binary relational operators

>

Greater-than

>=

Greater-than or equal

Less-than

<=

Less-than or equal

==

Equality

!=  or <>

Inequality

 

When a string comparison is made, the lengths of the strings are ignored. Instead, the comparison begins with the first character of each string. If the first characters of each match, the next characters of each are compared, continuing until a mismatch is found. The rules for string matches made using the Binary Relational Operators are:

Assignment operator

=

Assigns evaluated result of an expression to a variable.

 

Binary compound assignment operators

Operator

Example

Equivalent

Description

<<=

x <<= y

x = x << y

Left Shift with Assignment.

>>=

x >>= y

x = x >> y

Right Shift with Assignment.

&=

x &= y

x = x & y

Bitwise AND with Assignment.

|=

x |= y

x = x | y

Bitwise OR with Assignment.

^=

x ^= y

x = x ^ y

Bitwise Exclusive OR with Assignment.

*=

x *= y

x = x * y

Multiplication with Assignment.

/=

x /= y

x = x / y

Division with Assignment.

+=

x += y

x = x + y

Addition with Assignment.

-=

x -= y

x = x - y

Subtraction with Assignment.

:=

x := y

x = x : y

String Concatenation with Assignment.

mod=

x mod= y

x = x mod y

Modulo with Assignment.