Sub WriteBit(ByRef Data As byte,ByVal BitIndex As Integer, ByVal NewBit As Boolean)
If NewBit = True Then
Data = Data And Math.Pow(2, BitIndex)
Else
Data = Data And (&HFF - Math.Pow(2, BitIndex))
End If
End Sub
Function ReadBit(ByRef Data As byte,ByVal BitIndex As Integer) as Boolean
return (Data And Math.Pow(2, BitIndex))) / Math.Pow(2, BitIndex)
End Sub
沒有留言:
張貼留言