BITTEST() |
![]() ![]() ![]() |
The BITTEST() function tests the state of a specified bit in an integer value.
Format
BITTEST(expr, bit)
where
The BITTEST() function converts expr to a 32 bit integer and tests the state of the bit identified by bit, returning true (1) if it is set and false (0) if it is reset. Bits are numbered from 0 to 31 from the least significant end of the value. The effect of this function with a bit value outside this range is undefined.
Example
IF BITTEST(FLAGS, 2) THEN DISPLAY(IT$CS) :
This statement clears the screen if bit 2 is set in the FLAGS variable.
See also: BITAND(), BITNOT(), BITOR(), BITRESET(), BITSET(), BITXOR(), SHIFT() |