"Eqv" Equivalence Version 5 (Java)
Action group: Operators
Description
An identity (equality) operator that returns True if both operands have the same value.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
First operand | Value or variable of the first boolean operand | Robin.Boolean | true | Yes |
Second operand | Value or variable of the second boolean operand | Robin.Boolean | true | Yes |
Results | ||||
Result | Variable containing the result of the operation | Robin.Boolean | true |
Special conditions of use
None.
Example of use
Task
There is a "Logical variable 1" with value = true and "Logical variable 2" with value = false. We need to check the following expression: Logical variable 1 is equal to Logical variable 2. If the result is positive, output a dialog box with a message - true, if the result is negative, the message - false.
Solution
Use the actions "Equivalence" and "Show message".
Implementation
- Assemble a robot scheme consisting of actions:
- Create a numeric variable "Variable 3" into which the result of the "Equivalence action will be written.
- Move the "Equivalence" action to the workspace and set its parameters.
- Move the "If" action to the workspace and specify "Logical variable 3" in the action parameter.
- 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.
- tart the robot using the "Start" button in the top panel.
Result
The comparison of variable values has been performed successfully.
A dialog box with the result is displayed.
Обзор
Инструменты контента