Info | ||||
---|---|---|---|---|
| ||||
We want to provide you with the latest help content in your language as soon as possible. This page has been translated automatically and may contain grammatical errors or inaccuracies. We want this content to be useful to you. Please let us know at the bottom of this page if this information was helpful. View the original article in Russian: Выбор вариантов (Оператор "Switch") |
Описание
The Switch statement is an extended version Condition "If ... then ..." (Statement "IF") ...
If the “IF” statement has only two outcomes - True or False (green or red branches), then Switch has the ability to choose several options. In the absence of the desired option, the cube will be released on the “Default” branch.
How do I add an action to a project?
Via the context menu Add Action → Logic → Switch
...
Or use smart search .
What is
...
it used for?
Choosing an option from the list
Checking for a specific occurrence (match)
How do I use the action?
...
Variable
Here you need to specify the variable that we will check
...
Usage example
Imagine a situation in which we have a value for the switch_test variable.
Next, let's create operations Notification (Notification / Logging) for each of the options.
Example video
...
Expand | |||||
---|---|---|---|---|---|
| |||||
You can implement similar functionality via C # C # code (C sharp code .net) Sample code for the option above
|