Variable Assignment ':='

The Variable Assignment operator is used only within methods (PUB and PRI blocks), to assign a value to a variable. For example,

Temp   := 21
Triple := Temp * 3

At run time this code would set the Temp variable equal to 21 and set Triple to 21 * 3, which is 63.

As with other assignment operators, the Variable Assignment operator can be used within expressions to assign intermediate results, such as:

Triple := 1 + (Temp := 21) * 3 

This example first sets Temp to 21, then multiplies Temp by 3 and adds 1, finally assigning the result, 64, to Triple.

Unless otherwise noted, content on this site is licensed under the
Creative Commons Attribution-ShareAlike 4.0 International License.