Expressions consist of operands linked by operators based on their precedence.
Example |
Description |
A+B |
The sum of operands A and B is called expression. |
When their precedence is the same, processing proceeds from left to right.
With the values A:=1.0; B:=2.0; C:=3.0; and D:=4.0; for |
|
X:=A+B-C*SQRT(D); |
the result is -3. |
By inserting parentheses, the processing order can be changed, e.g. for |
|
X:=A+(B-C)*SQRT(D); |
the result is -1. |
Boolean expressions are always fully processed:
|
In this case, UserFun1 is also processed if a>=100. |
|
When you wish to avoid processing UserFun1 for whatever reason, e.g. it’s too time-consuming, or when a>=100 an operation error occurs, or because the memory area will be overwritten, you can write, for example: |
|
Expressions can also indicate elements of an array:
X:=Array1[i+2];