TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: DAVID ROTHSCHILD
from: BILL WHITE
date: 1998-03-10 13:49:00
subject: Individual bits

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.