DR> How do can I read the individual bits that are inside a byte?
Using Boolean Algebra, usually the AND Operator is
what you want. See F1 Help.
Suppose you want to know if the sixth bit is on.
IF a AND 32 THEN
If true, it is; if false, it isn't. Decimal 32 is
binary 00100000. If that sixth bit is also on in your
variable "a", then the statement will be true.
a = 00101010
AND 00100000
result 00100000 therefore sixth bit is on.
a = 01001010
AND 00100000
result 00000000 therefore sixth bit is off.
HTH
FIDO: Bill White @ 1:135/110 (Miami)
InterNet: bill.white@110.sunshine.com
* SLMR 2.1a * Don't accept unacceptable behavior!
--- Maximus 2.01wb
---------------
* Origin: Miami Amateur Computer Club BBS/USR Courier V.E (1:135/110)
|