How To Use Logic Expressions

How To Use Logic Expressions

Welcome to our Knowledge Base

Documentation | Blog | Demos | Support

< All Topics
Print

How To Use Logic Expressions

A logic expression is an expression that, when evaluated, yields either a $True or a $False result.

Logic expressions are subdivided into conditional expressions and Boolean expressions.

How To Construct Conditional Expressions

A conditional expression is a complex logic expression that consists of two value expressions and an associated conditional operator. The conditional operator performs a designated comparison of the value expressions and returns the result $True or $False. Conditional expressions can be combined into Boolean expressions.

The conditional operators are

= (equals)

<> (not equals)

< (less than)

> (greater than)

<= (less than or equals)

>= (greater than or equals)

[NOT] BETWEEN

[NOT] IN

[NOT] LIKE

Examples of Conditional Expressions

EmpNum < 1254

DeptNum >= EmpNum

First Name = “Smith”

DeptDesc <> “Sports”

EmpNum between 1000 and 2000

LastName like “%ith%”

Event.EventName in (“F1”, “F2”, “Escape”)

ProdCode not between 542 and 863

LastName not in (“Smith”, “Jones”)

FirstName not like “Sm%”

How To Use Boolean Expressions

A Boolean expression is a complex logic expression that consists of one or more conditional expressions and an associated Boolean operator. The Boolean operator performs a Boolean operation on the $True or $False values returned by the conditional expression(s) and returns the result $True or $False.

The Boolean operators are

AND

OR

XOR

NOT

Examples of Boolean Expressions

LastName = “Allan” or FirstName = “Allan”

DeptNum = “Sports” and Salary > 45000 and LastName = “Smith”

not Salary > 45000

See Also

$and

$not

$or

Truth Tables

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

en_CAEnglish