Guest User

Untitled

a guest
May 26th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. Protected Sub SetBit(ByRef oByte As Byte, ByVal BitPosition As Integer, ByVal NewPosition As Boolean)
  2. Dim newByte As Byte = oByte
  3. If ((oByte And 2 ^ BitPosition) <> False And NewPosition = False) Then
  4. newByte = oByte Xor 2 ^ (BitPosition)
  5. ElseIf ((oByte And 2 ^ BitPosition) = False And NewPosition = True) Then
  6. newByte = oByte Or 2 ^ (BitPosition)
  7. End If
  8. oByte = newByte
  9. End Sub
Add Comment
Please, Sign In to add comment