*Logical Operators*

Logical operators allow comparison and conditional execution (e.g., If trial > 5 Then…). Often, in script, expressions are used, which compare items using simple mathematical expressions.

> |
Greater than |

< |
Less than |

= |
Equal to |

>= |
Greater than or equal to |

<= |
Less than or equal to |

<> |
Not equal to |

Logical operators are also commonly used in compound expressions. Essentially, logical operators evaluate two expressions and use a set of rules to determine if the total expression is true or false.

Operator |
Returns True |
Example |
Result |

And |
If both expressions are true |
5 > 2 And 6 + 3 = 9 | True |

3 * 3 = 9 And 7 < 6 | False | ||

Or | If either expression is true | 5 > 7 Or 8 * 2 = 16 | True |

8 < 4 Or 3 > 2 | False | ||

Xor | If only one expression is true. Note that it is False if expressions are either both true or both false. | 3 + 2 = 5 Xor 5 + 5 >10 | True |

3 + 2 = 5 Xor 5 + 5 = 10 | False | ||

**See Also:**

## Comments

0 comments

Please sign in to leave a comment.