История страницы
"=="
...
Equal to Version 6 (Java)
Группа действийAction group: Операторы Operators
...
Description
Возвращает True, если первый операнд равен второму. Иначе Returns True if the first operand is equal to the second operand. Otherwise False.
...
Action icon
Параметры
Входные параметры
Поле "Операнд 1" - Выражение, имеющее результат числового типа или числовая переменная.
Поле "Операнд 2" - Выражение, имеющее результат числового типа или числовая переменная.
Выходные параметры
Результат - Логическая переменная, содержащая результат действия робота
Настройки
...
Свойство
...
Англ. наименование
...
Описание
...
Тип
...
Пример заполнения
...
Обязательность заполнения поля
...
Параметры
...
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
First operand | Value or variable of the first opreand | Robin.Object | Yes | |
Second operand | Value or variable of the second opreand | Robin.Object | Yes | |
Results | ||||
Result | The result of the comparison, true if the two numbers (or untyped objects) are equal, false otherwise. | Robin.Boolean | true |
Special conditions of use
None.
Example of use
Task
There is "Variable1" with value = 17 and "Variable2" with value = 3. It is required that Variable1=Variable2. If the result is positive, output a dialog box with a message - true, if the result is negative, output a dialog box with a message - false.
Solution
Use the actions "Equal to", "If", "Show message".
Implementation
- Assemble a robot scheme consisting of actions:
- Create a variable with the boolean type "Variable3" to record the result of the "Equal" action into it.
- Move the "Equal to" action to the workspace and set its parameters.
- Move the "If" action to the workspace and set the action parameter to "Variable3".
- In the "True" branch, add the "Show message" action and set its parameters.
- In the "False" branch, add the "Show message" action and set its parameters.
- Launch the robot using the "Start" button and the top panel.
Result
The comparison of variable values has been performed successfully, the dialog box with the result is displayed
Особые условия использования
Отсутствуют.
Пример использования
Задача
Существует "Переменная 1" со значением = 17 и "Переменная 2" со значением = 3. Требуется равество переменных Переменная 1=Переменная 2. При положительном результате вывести диалоговое окно с сообщением - верно, при отрицательном результате с сообщением - неверно.
Решение:
Воспользоваться действиями "Равно", "Если", "Сообщение".
Реализация
- Создать переменную с типом логический "Переменная 3" для записи в нее результата действия "Равно".
- Перетащить действие "Равно" на рабочую область и настроить его параметры.
- Перетащить действие "Если" на рабочую область и указать в параметре действия "Переменную 3".
- В ветвь "Истина" добавить действие "Сообщение" и настроить его параметры.
- В ветвь "Ложь" добавить действие "Сообщение" и настроить его параметры.
- Запустить робота по кнопке "Запуск" и верхней панели.
Результат
Сравнение значений переменных выполнено успешно, отображено диалоговое окно с результатом