244
Chapter 12: Methods
bitNot()
Usage
(
integer
).bitNot
bitNot(
integer
)
Description
Function (Lingo only); converts the specified integer to a 32-bit binary number and reverses the
value of each binary digit, replacing 1’s with 0’s and 0’s with 1’s. The result is the new binary
number, which Lingo displays as a base 10 integer.
In JavaScript syntax, use the bitwise operator "
~
".
Parameters
None.
Example
This statement inverts the binary representation of the integer 1 and returns a new number.
put (1).bitNot
-- -2
See also
bitAnd()
,
bitOr()
,
bitXor()
bitOr()
Usage
bitOr(
integer1
,
integer2
)
Description
Function (Lingo only); converts the two specified integers to 32-bit binary numbers and returns a
binary number whose digits are 1’s in the positions where either number had a 1, and 0’s in every
other position. The result is the new binary number, which Lingo displays as a base 10 integer.
In JavaScript syntax, use the bitwise operator "
|
".
Integer
Binary number
1
00000000000000000000000000000001
Result
-2
11111111111111111111111111111110
Integer
Binary number (abbreviated)
5
0101
6
0110
Result
7
0111
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...