Operators

Top  Previous  Next

The VPL programming language offers the following operators.

 

The number to the left of each operator shows the priority of the operator. Operators with the same priority are evaluated from left to right.

 

1.

(expression)

 

Parenthesis (brackets).

2.

function evaluation

Function call.

 

SIZEOF

Size of operator.

 

ADDR

Address operator.


@

Address-of a callback function operator.


BYTE(expression)

Typecast expression to BYTE.


UINT(expression)

Typecast expression to UINT.

 

INT(expression)

Typecast expression to INT.


USINT(expression)

Typecast expression to USINT.

 

SINT(expression)

Typecast expression to SINT.

 

DINT(expression)

Typecast expression to DINT.

 

BOOL(expression)

Typecast expression to BOOL.


DOUBLE(expression)

Typecase expression to DOUBLE.

 

FLOAT(expression)

Typecast expression to FLOAT.

 

FLOATB(expression)

Typecast expression to FLOAT binary.

 

Unary operators

 

3.

-

Negating.


NOT

Logic negation.

4.

**

Exponential.

 

Arithmetic operators

 

5.

*

Multiplication.

 

/

Division.


MOD

Modulus.

6.

+

Addition.

 

-

Subtraction.

 

Relational(comparison) operators

 

7.

<

Less than.

 

<=

Less than or equal.

 

>

Greater than.

 

>=

Greater than or equal.

 

=

Equal.

 

<>

Different from.

 

Logical operators

 

8.

AND

Boolean AND/Bitwise AND.

9.

XOR

Boolean Exclusive OR/Bitwise Exclusive OR.

10.

OR

Boolean OR/Bitwise OR.