Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Protected Sub SetBit(ByRef oByte As Byte, ByVal BitPosition As Integer, ByVal NewPosition As Boolean)
- Dim newByte As Byte = oByte
- If ((oByte And 2 ^ BitPosition) <> False And NewPosition = False) Then
- newByte = oByte Xor 2 ^ (BitPosition)
- ElseIf ((oByte And 2 ^ BitPosition) = False And NewPosition = True) Then
- newByte = oByte Or 2 ^ (BitPosition)
- End If
- oByte = newByte
- End Sub
Add Comment
Please, Sign In to add comment