Functions Delphi

Title: Bit manipulating functions
Question: Functions to work with bits
Answer:
Functions that will be (i guess) always needed...
function IsBitSet(const val:longint; const TheBit:byte): boolean;
begin
Result := (val and (1 shl TheBit)) 0;
end;
function BitOn(const val: longint; const TheBit: byte): LongInt;
begin
Result := val or (1 shl TheBit);
end;
function BitOff(const val: longint; const TheBit: byte): LongInt;
begin
Result := val and ((1 shl TheBit) xor $FFFFFFFF);
end;
function BitToggle(const val:longint;const TheBit:byte): LongInt;
begin
Result := val xor (1 shl TheBit);
end;