Logical operators
Syntax
And operation
$e1 && $e2
$e1 and $e2
Combination of the Boolean expressions e1
and e2
, which evaluates to true if e1
and e2
evaluate to true.
Or operation
$e1 || $e2
$e1 or $e2
Combination of the Boolean expressions e1
and e2
, which evaluates to true if either e1
or e2
or both evaluate to true.
Negation
!$expr
Boolean expression that evaluates to true if expr
evaluates to false.
Description
Logical operators are syntactic components of TL-Script. No function notation is used for them, but operators common in other languages can be used. The following sections explain the syntax used.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
e | Boolean | A boolean expression. | yes |
Return Value
Type: Boolean
The result of the logical operation on the expressions.
Examples
And
5 > 4 && 5 < 6
oder
5 > 4 and 5 < 6
Output: true
Or
"HELLO".isStringEqual("hello") || "HELLO".stringContains("Bye")
oder
"HELLO".isStringEqual("hello") or "HELLO".stringContains("Bye")
Output: true
Negation
!"HELLO".isStringEqual("hello", true)
Output: true