Logical Operators

Top  Previous  Next

 

Pipeline Runner supports Logical operators in the validation section of an If command, along with the use of parentheses to allow grouping of conditions. This allows the user to build up complex sets of conditions and then use the result of the evaluation of those conditions to run a command or choice of commands to provide the required action.

 

Conditional Logical AND operator - &&

 

The conditional logical AND operator && computes the logical AND of its operands. The result of x && y is true if both x and y evaluate to true. Otherwise, the result is false.

 

Conditional Logical OR operator - ||

 

The conditional logical OR operator || computes the logical OR of its operands. The result of x || y is true if either x or y evaluates to true. Otherwise, the result is false.

 

Operator precedence

 

Operator precedence means the order in which the operators are processed. In Pipeline Runner the logical operators are processed in the following order:

 

Conditional logical AND operator - &&

Conditional logical OR operator - ||

 

You can use parentheses also known as round brackets - () - to change the order of evaluation imposed by operator precedence. For example:

 

A || B && C - A is evaluated first

 

(A || B) && C  - C is evaluated first

 

See Also: If Command Escaped Strings Reserved Characters Reserved Strings Splitting Command Lines