switch
This block is part of the number group and was last modified in core v12.0.4.
switch v12.0.4 Returns a number based of the given expression.
In pins 2
- expression required
valueThe expression to evaluate.
- default
numberThe default statement to be executed.
Out pins 2
- output
numberReturns the number matching the expression.
- match
conditionReturns true in case a match was found.
Outputs the number pin of the case matching the value/expression pin, with matched=true; when no case matches it outputs the default pin with matched=false. Case selection is pre-computed by the engine before this block runs, values pass through without coercion, and with no selection at all the output is number=nil, matched=false.
A typical wiring for switch: the number out pin feeds cast to value.
Version history
Introduced in v12.0.4.
Back to
number Return to the main group to view all sub-groups Back to number Return to the group to view all blocks within this group 