bitSet()
Purpose
Set or clear a bit in a binary number
Description
Set (1) or clear (0) the specfied bit in a 32 bit signed binary number
Syntax
result = bitSet( number, bit, value )
Arguments
number Initial number value
bit Bit to set or clear (0-31). Bit 31 is the sign bit.
value 1 (set) or 0 (clear)
result Resulting number value
Example
number = 0
for i = 0 to 16 loop
number = bitSet( number, i, 1 )
printAt( 0, i , number )
update()
repeat
sleep( 3 )
Associated Commands