Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.168 Beiträge
 
Delphi 12 Athens
 
#6

Re: 32bit dword / wie finde ich raus ob bit 0,1 oder 2 geset

  Alt 10. Nov 2003, 18:04
Chewie's stimmt in etwa mit meinem überein:

aus Sakura's Tut:
Delphi-Quellcode:
(1 shl 0) = $01 {1. Bit}
(1 shl 1) = $02 {2. Bit}
(1 shl 2) = $04 {3. Bit}
...
(1 shl 4) = $20 {5. Bit}
...
Delphi-Quellcode:
Bit1 := (irrgendwas and $02) <> 0;
{oder}
If (irrgendwas and $02) <> 0 Then ...
Delphi-Quellcode:
Bitnummer := 4; {5. Bit / Bit 0 bis 31} 

Bit := (irrgendwas and ($01 shl Bitnummer)) <> 0;
{oder}
If (irrgendwas and ($01 shl Bitnummer)) <> 0 Then ...
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat