Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Switch Version 5 (Net)

Группа действий: Базовые действия

Описание

Данное действие предназначено для выбора выполнения одного раздела ветвления из списка вариантов, сравнивая их с выражением соответствия.

Для добавления нового условия необходимо нажимать на кнопку "Image Removed", расположенной на самом действии. 

Action group: Base actions

...

Description

The action selects the execution of a single branching section from a list of options, comparing them to a match expression.

To add a new conditions click on the "Image Added" button in the action.

To add a default transition branch, click on the "Image Added" button in the actionДля добавления ветки перехода по умолчанию необходимо нажимать на кнопку "Image Removed", расположенной на самом действии.

 

...

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
ConditionThe value to be matched against branches“ values to select executing branchRobin.String
Yes
Branch 1 conditionIf matches the condition, the corresponding branch will be executedRobin.String
Yes
Branch 2 conditionIf matches the condition, the corresponding branch will be executedRobin.String
Yes

Особые условия использования

При добавлении ветки перехода по умолчанию, данная ветка будет исполнена, если условие не совпало в остальных ветках.

Пример использования

Задача

Существует переменная с типом "Строка", содержащая значение "Red".

Необходимо перейти на соответствующий раздел ветвления и вывести в лог сообщение.

Решение

  1. Добавить ветвление.
  2. Добавить сообщение в лог.

Реализация

Special conditions of use

When adding a default transition branch, this branch will be executed if the condition did not match in the other branches.

Example of use

Task

There is a variable with type "String" containing the value "Red".

You need to go to the appropriate branching section and output a message to the log.

Solution

  1. Add switch.
  2. Add message to log.

Implementation

  1. Create a variable "String_ Variable 1" with the type "String", which will be an expression and contain the text "Red".

  2. Open the "Base action" action group.

  3. Move the "Switch" action to the workspace.

  4. Triple-click on the "Image Added" button in the action.

  5. Action settings:

    1. "Condition" parameter. Select the variable "Branch 1 condition", the value of which will be checked for compliance with the conditions.

    2. "Branch 1 condition" parameter. Select the result of the expression "Blue", which will be compared with the value in the "Conditions" field of the "Switch" action.

    3. "Branch 2 condition" parameter. Select the result of the expression "Red", which will be compared with the value in the "Conditions" field of the "Switch" action.

    4. "Branch 3 condition" parameter. Select the result of the expression "Black", which will be compared with the value in the "Conditions" field of the "Switch" action.

    Image Added

  6. Place the "Message in log" action with the message "Branch no.1", "Branch no.2" and "Branch no.3" corresponding to the branch number (read action description

  7. Создать переменную "Строковая_переменная1" с типом "Строка", которая будет являться выражением и содержать текст "Red".

  8. Открыть группу действий "Базовые действия".

  9. Поместить в рабочее пространство студии действие "Ветвление". 

  10. Нажать три раза на кнопку "Image Removed" на действии.

  11. Настройка действия: 

    1. Параметр "Условие". Выбрать переменную "Строковая_переменная1", значение которой будет проверяться на соответствие условиям.

    2. Параметр "Условие для Ветки 1". Выбрать результат выражение "Blue", который будет сравниваться со значением в поле "Условия" действия "Ветвление".

    3. Параметр "Условие для Ветки 2". Выбрать результат выражение "Red", который будет сравниваться со значением в поле "Условия" действия "Ветвление".

    4. Параметр "Условие для Ветки 3". Выбрать результат выражение "Black", который будет сравниваться со значением в поле "Условия" действия "Ветвление".

    Image Removed

  12. Поместить действие "Message in log" с сообщением "Ветвь №1", "Ветвь №2" и "Ветвь №3" соответствующую номеру ветвь (см. описание действия "Message in log"). 

  13. Запустить робота по кнопке "Запуск" в верхней панели.

Результат

  1. Click "Start" in the top panel to start the robot.

Result

The algorithm went through branch No. 2 and output the message to the log "Branch No. 2Алгоритм прошел по ветви №2 и вывел сообщение в лог  "Ветвь №2".