"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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
First operandValue or variable of the first boolean operandRobin.BooleantrueYes
Second operandValue or variable of the second boolean operandRobin.BooleantrueYes
Results
ResultVariable containing the result of the operationRobin.Booleantrue

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 

  1. Assemble a robot scheme consisting of actions

  2. Create a numeric variable "Variable 3" into which the result of the "Equivalence action will be written
  3. Move the "Equivalence" action to the workspace and set its parameters.
  4. Move the "If" action to the workspace and specify "Logical variable 3" in the action parameter. 
  5. In the "True" branch, add the "Show message" action and set its parameters.
  6. In the "False" branch, add the "Show message" action and set its parameters.
  7. 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.

  • Нет меток