This is an old revision of the document!
Calculate
The Calculate element can arithmetically manipulate Variables, whereby the I/O remains unmodified.
Usage
This Flow Control element can apply standard arithmetic (+,-,*,/) onto a Variable. Furthermore, the modulo (%) and exponentiation (^) methods are implemented in Lua 5.1. Recall that a calculation of a Variable of type decimal and a Variable of type integer returns a decimal Variable.
To edit the formula fill in the Formula field in the Properties. Please note that Variables are called with cow.VariableName.
cow.VariableName = cow.VariableName + (any standard arithmetic symbol ) constant/cow.VariableName
Example
Properties Window
![]() | ![]() | The logic BoxManipulation gets the Variable factor as the coarse factor. |
![]() | ![]() | Here the Variable called factor is an integer with default value 2. To see how to set up and use a follow the Variablelink. |
![]() | ![]() | After clicking into the grey window of the Group it will display the current value of the Variable factor. |
![]() | ![]() | The Calculate element displays the computation. Here the sum of the Variable factor and one is written back to the Variable factor. |
Parameters and I/O
Input | Description |
---|---|
FirstInput | Input is passed along and triggers Calculate |
Output | Description |
---|---|
FirstOutput | Output which is unmodified |