Sub AppStart (Form1 As Form, Args() As String)
Dim b As Byte
b = SetBit(b, 7, False)
b = SetBit(b, 6, True)
b = SetBit(b, 5, True)
b = SetBit(b, 4, True)
Dim bc As ByteConverter
Log(bc.HexFromBytes(Array As Byte(b)))
End Sub
Sub SetBit(b As Byte, index As Int, value As Boolean) As Byte
If value Then
Return Bit.Or(b, Bit.ShiftLeft(1, index))
Else
Return Bit.And(b, Bit.Not(Bit.ShiftLeft(1, index)))
End If
End Sub