Einzelnen Beitrag anzeigen

js747a

Registriert seit: 11. Aug 2008
Ort: Nord hessen
43 Beiträge
 
Delphi 7 Enterprise
 
#24

AW: Index vom x-tem gesetztem Bit

  Alt 16. Jun 2020, 15:44
Var byte1 : Byte;

If (byte1 AND 1) = 1 then ..... Bit 1 gesetzt (=1)
If (byte1 AND 2) = 2 then ..... Bit 2 gesetzt (=1)
If (byte1 AND 4) = 4 then ..... Bit 3 gesetzt (=1)
If (byte1 AND 8) = 8 then ..... Bit 4 gesetzt (=1)
If (byte1 AND 16) = 16 then ..... Bit 5 gesetzt (=1)
If (byte1 AND 32) = 32 then ..... Bit 6 gesetzt (=1)
If (byte1 AND 64) = 64 then ..... Bit 7 gesetzt (=1)
If (byte1 AND 128) = 128 then ..... Bit 8 gesetzt(=1)
  Mit Zitat antworten Zitat