Relational operators

Relational operators compare two values and return a logical (TRUE or FALSE) result. They can be used to compare numbers, character strings, or numerical and character variables.

Relational Operator What it means
=

Equal to

<>

Not equal to

<

Less than

>

Greater than

<=

Less than or equal to

>=

Greater than or equal to

The following table contains some examples of how you might use relational operators in an expression.

Expression What it does
Fuel > 15

Compares the value of custom variable Fuel to 15, returning a value of TRUE or FALSE.

Topic > 1

Returns a value of TRUE if the custom variable Topic is greater than 1; otherwise returns a value of FALSE.

Note number <= Total

Returns a value of TRUE if Note number is less than or equal to Total; otherwise returns a value of FALSE.

Completed = False

Compares the value of the custom variable Completed with False. If Completed is FALSE, returns a value of TRUE; if Completed is TRUE, returns a value of FALSE.

Number of lines = 15

Returns a value of TRUE if the custom variable Number of lines equals 15; otherwise returns a value of FALSE.

Notice that in the last two examples the equal sign (=) is used rather than the assignment operator (:=). The assignment operator is used to assign a value to a variable. The equal sign (=) is used to compare two values or variables.

See also


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/authorware/7/using_aw_en/09_var55.htm