Forum: Object-Pascal / Delphi-Language
Delphi
by SirThornberry,
11. Jul 2004
Thx. TBitIndex hatte ich von 1 bis 64 definiert um mit Int64 noch arbeiten zu können wobei mir dann aufgefallen ist das es schwachsinn ist da meine funktion ja nur mit Integern arbeitet.
Wenn ich mir von Hagen
function BitSet(Value: Cardinal; State: Boolean; Index: Cardinal): Cardinal;
begin
if State then Result := Value or (1 shl Index)
else Result := Value and not (1 shl Index);...
Forum: Object-Pascal / Delphi-Language
Delphi
by SirThornberry,
10. Jul 2004
hallo,
kann man
function SetBit(const AByte: Integer; const ANewBitStatus: Boolean; const ABitIndex: TBitIndex): Integer;
begin
if ANewBitStatus then
result := AByte or (1 shl (ABitIndex - 1))
else
result := AByte and not(1 shl (ABitIndex - 1));