614
Chapter 13: Operators
not
Usage
-- Lingo syntax
not
logicalExpression
// JavaScript syntax
!
logicalExpression
Description
Operator; performs a logical negation on a logical expression. This is the equivalent of making a
TRUE
value
FALSE
, and making a
FALSE
value
TRUE
. It is useful when testing to see if a certain
known condition is not the case.
This logical operator has a precedence level of 5.
Example
This statement determines whether 1 is not less than 2:
-- Lingo syntax
put(not (1 < 2))
// JavaScript syntax
put(!(1 < 2));
Because 1 is less than 2, the result is 0, which indicates that the expression is
FALSE
.
This statement determines whether 1 is not greater than 2:
-- Lingo syntax
put(not (1 > 2))
// JavaScript syntax
put(!(1 > 2));
Because 1 is not greater than 2, the result is 1, which indicates that the expression is
TRUE
.
This handler sets
the checkMark
menu item property for Bold in the Style menu to the opposite
of its current setting:
-- Lingo syntax
on resetMenuItem
menu("Style").menuItem("Bold").checkMark = \
not (menu("Style").menuItem("Bold").checkMark)
end resetMenuItem
// JavaScript syntax
function resetMenuItem() {
menu("Style").menuItem("Bold").checkMark =
!(menu("Style").menuItem("Bold").checkMark)
}
See also
and
,
or
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...