"<=" Less than or equal to Version 5 (Java)
Action group: Operators
Description
Returns True if the first operand is less than or equal to the second operand. Otherwise False.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
First operand | Value or variable of the first operand | Robin.Numeric | Yes | |
Second operand | Value or variable of the second operand | Robin.Numeric | Yes | |
Results | ||||
Result | The result of the comparison, true if the first number is less than or equal to the other, 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 to check the expression 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 "Less than or equal to", "If", "Show message".
Implementation
- Assemble a robot scheme:
- Create a variable with the boolean type "Variable3" to record the result of the "Less than or equal to" action into it.
- Move the "Less than or 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 "Launch" button and the top panel.
Result
The comparison of variable values is successful, the dialog box with the result is displayed
Обзор
Инструменты контента