Using Director > Writing Scripts with Lingo > Using operators to manipulate values > Logical operators

 

Logical operators

Logical operators test whether two logical expressions are true or false. These are the logical operators available in Lingo:

Operator

Effect

Precedence

and

Determines whether both expressions are true.

4

or

Determines whether either or both expressions are true.

4

not

Negates an expression.

5


The not operator is useful for toggling a TRUE or FALSE value to its opposite. For example, the following statement turns on the sound if it's currently off and turns off the sound if it's currently on:

set the soundEnabled = not (the soundEnabled)