Operácie s bitmi

Nastavenie bitu na 1

Function BitT(n As Long, pos As Long) As Long
    BitT = n Or IIf(pos = 31, -2, 2) ^ pos
End Function


Nastavenie bitu na 0

Function BitF(n As Long, pos As Long) As Long
    BitF = (n And (Not IIf(pos = 31, -2, 2) ^ pos))
End Function


Testovanie hodnoty bitu

Function TestBit(n As Long, pos As Long) As Boolean
    TestBit = (n And IIf(pos = 31, -2, 2) ^ pos) <> 0
End Function