Instructions

200Compiler
© 2013 Conrad Electronic
Sub func1()
Static a As Integer
End Sub
In opposition to normal local variables will static variables still keep their value even if the function is
left. At a further call-up of the function the static variable will have the same contents as when leaving
the function. In order to have the contents of a Static variable defined at first access the static vari-
ables will equally to global variables at program start also be initialized by zero.
4.3.5 Operators
Priorities of Operators
Operators separate arithmetic expressions into partial expressions. The operators are then evaluated
in the succession of their priorities (precedence). Expressions with operators of identical precedence
will be calculated from left to right.
Example:
i= 2+3*4-5 ' result 9 => first 3*4, then +2, finally -5
The succession of the execution can be influenced by setting of parenthesis. Parenthesis have the
highest priority.
If the last example should strictly be calculated from left to right, then:
i= (2+3)*4-5 ' result 15 => first 2+3, then *4, finally -5
A list of priorities can be found in Precedence Table.
4.3.5.1 Arithmetic Operators
All arithmetic operators with the exception of Modulo are defined for Integer and Floating Point data
types. Modulo is restricted to data type Integer only.
It must be observed that in an expression the figure 7 will have an Integer data type assigned to
it. If a figure of data type Single should be explicitly created then a decimal point has to be added:
7.0
Operator
Description
Example
Result
+
Addition
2+1
3.2 + 4
3
7.2
-
Subtraction
2 - 3
22 - 1.1e1
-1
11
*
Multiplication
5 * 4
20
/
Division
7 / 2
7.0 / 2
3
3.5
Mod
Modulo
15 Mod 4
17 Mod 2
3
1