Conditional operators
- Last UpdatedDec 06, 2023
- 2 minute read
In some cases, the execution of commands or the routing of values can be restricted by conditional constraints. These conditions are generally set inside the condition field for that type of nodes.
Guidelines
-
The execution of the statement set inside this field must result in a Boolean value: True or False.
-
The script supports a list of conditional operators that you can use inside fields in various combinations.
-
In the case of SBOOLs or SSTRINGs containing True or False, you can use the field directly (also with negation) instead of using @node.field@==true or @node.field@==false.
-
You can also use constants of every field type to compose the conditional constraints. True and False are the SBOOL constant values.
Operators
A list of conditional operators.
|
Operator |
Description |
Example |
|---|---|---|
|
== |
Checks whether the two operators have the same value. Can be used with all parameter types. |
[@buttonDrag.buttonDown]==true |
|
!= |
Checks whether the two operators have different values. Can be used with all parameter types. |
[@seta.state]!=init |
|
> (>) |
Checks whether the left operator is greater than the right one. It applies only to SFLOAT parameter or variables. |
[@a.fov]>[@b.fov] |
|
>= (>=) |
Checks whether the left operator is greater or equal to the right one. It applies only to SFLOAT parameter or variables. |
[@a.fov]>=[@b.fov] |
|
< (<) |
Checks whether the left operator is lower than the right one. It applies only to SFLOAT parameter or variables. |
[@a.fov]<[@b.fov] |
|
<= (<=) |
Checks whether the left operator is lower or equal to the right one. It applies only to SFLOATparameter or variables. |
[@a.fov]<=[@b.fov] |
|
^ |
Performs a logical AND between two operators. It applies only to SBOOL parameter and variables, or to the result of other conditional operations. |
[@b.active]^[@p.state]==init |
|
+ |
Performs a logical OR between two operators. It applies only to SBOOL parameter and variables, or to the result of other conditional operations. |
[@b.active]+[@p.state]==init |
|
! |
Performs a logical NOT on an operator. Can be used only for direct values (SBOOL) |
![@b.active] |
Additional notes
-
Conditional operators do not support brackets. There may be conditions with a single conditional block, a logical AND ('^') of blocks, a logical OR ('+') of blocks. You cannot mix them.
-
The NOT operator ('!') can be used only on direct parameters, not on members of a logical operation with two operands.
Examples
condition="@menuvisible==false^@menuactive==true^@global.currentContext!=seta"
condition="@lang@==ita"
condition="@interactive@==true"
condition="!@node.field@"