section: < previous | next > | | | |
chapter: << previous | next >> |
4.3 IfThenElse-Expressions
Constraints are often defined by using case distinctions of the form if [expression1] then [expression2] else [expression3]. Therefor, VOCL provides a container-figure, which can held three nested expressions, one for each of those used in case-distinctions.
a) Creating an IfThenElse-Expression
To create a case distinction out of other expressions, you have to add an IfThenElse container to an existing one. When having an empty constraint in place, following these steps:- First of all, select the IfThenElse Expression-Button from among the Container items. Then click inside the constraint-figure, where the new container should be placed.
- The IfThenElse-Container appears without prompting a dialog, because no settings have to be done (see fig. 4.3.1).
Subsequently adding this expression is also possible, as presented in the previous chapter. Doing so, the expression is copied to all three sub-expressions. But negation is only available on one of the nested containers.
|
Fig. 4.3.1 - Figure of IfThenElse-Expression
section: < previous | next > | | | |
chapter: << previous | next >> |