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

全站熱搜

傑克鼠 發表在 痞客邦 留言(3) 人氣()