Condition objects


Condition

Condition objects are simpler versions of Calculator objects. If objects only allow one single expression to be entered which returns an integer value. This is mostly intented for use together with the "yes" and "no" objects to create conditional branches, see Yes/No objects.

The condition object creates a C function like that:

#include <vflcalc.h> ... variable definitions ... extern "C" int run() { return expression; } expression is replaced with the code line which is entered in the property dialog. The code is then compiled to a shared object which is loaded during execution. After compilation the shared object binary is stored inside the vimms project file. Variables specified at "Input variables" appear as input variables of the condition object and can be used using the given variable name within the expression.
Fig. 1: Property dialog
Figure 1 showas an usage example of the condition object.

When changing the expression the code has to be compiled, this is also automatically done when pressing the "Dismiss" button and closing the dialog. Af any errors are encontered during compilation they are shown in the compile output window. The value of the evaluated expression appears in the output variable of the condition object.


The Vimms User Manual