Using Comparison Operators

There are six comparison operators that can be used to compare one expression with another: >, <, =, >=, <=, and <>.

An example of a comparison operator is >, the "greater than" operator, which can be used to compare two numbers, or two strings. If the comparison turns out to be TRUE, the value of the entire expression is 1. If the comparison turns out to be FALSE, the value of the expression is 0.

Example: 3 > 4, which reads "3 is greater than 4," is a valid PracticeScript expression. This statement is FALSE since 3 is not greater than 4, so the value of this expression is 0.

Comparison operators are valid for both numbers and character strings.

Comparison Operators

Operator

Meaning

Example

>

Greater than

4>3

<

Less than

3<4

=

Equal to

3+1=4

>=

Greater than OR equal to

"Smith">"Jones"

<=

Less than OR equal to

"Adams"<="Smith"

<>

NOT equal to

"Adams"<>"Smith"

 

Related Topics

Using PracticeScript Operators

Using Functions

Using Variables