Skip to content

Not Command Component

Obsolete

This command component is replaced by the Not function.

Indicators are also obsolete, with the exception of predefined indicators that already exist in the language. Among the reasons for this is the limit of 89 user-defined indicators per program and that indicators are global.

Use the Boolean command to declare Boolean variables instead or declare properties in classes and objects. You can use the move command to set and retrieve the value of indicators.

See Also

Purpose

To invert the logical value of an expression or an indicator or group of indicators, controlling, or being set by, a command.

Syntax

not
expression

or Legacy Syntax

n
ot
indicator

What It Does

The word not in front of the name of an indicator being set by a command causes the value of indicator to be set to the inverse of the result of the test. If the test is true, indicator is set to false. If the test is false, indicator is set to true.

indicate not good as group any [evil vicious]

In this example, if either indicator evil or vicious is true, indicator good is set to false.

In front of the name of an indicator which controls a command, the command is executed if the indicator is false, and not executed if the indicator is true.

[not rainy not dark] gosub fishing

In this example, if both indicators rainy and dark are false, subroutine fishing will be executed.

Not may be placed before the name of any indicator within a set of brackets.

Not also inverts the Boolean value of expressions.

if not (females > males) gosub nextparty

In this example, if the value of variable females is not greater than the value of variable males, subroutine nextparty is executed.

Not also inverts the Boolean values of variables. A variable value of 0 or blank is Boolean value false, and any other value, positive or negative, is true.

indicate leapyear as not (mod(year, 4))

In this example, indicator leapyear is set true if the modulo 4 of the value of variable year is 0 (false), and false if the integer expression is other than 0 (true).

Notes

  • The value of an indicator may be reversed by use of not with the indicate command.

    indicate true as not tru
    
  • In this example, the value of indicator tru is changed to false if it is true, or true if it is false.