This works:
This does not:
This also does not:
By my understanding, each of the above should produce the same result. The first version is the easiest to follow, but the last is the most terse.
B4X:
Private Sub WriteToSerialPort(Data As Int)
Dim StringToSend As String = Chr(Data)
Dim DataToSend() As Byte = StringToSend.GetBytes("ISO8859_1")
Stream.Write(DataToSend)
Log("-----------Sent->" & Data )
End Sub
This does not:
B4X:
Private Sub WriteToSerialPort(Data As Int)
Dim DataToSend() As Byte = Chr(Data).GetBytes("ISO8859_1")
Stream.Write(DataToSend)
Log("-----------Sent->" & Data )
End Sub
This also does not:
B4X:
Private Sub WriteToSerialPort(Data As Int)
Stream.Write(Chr(Data).GetBytes("ISO8859_1"))
Log("-----------Sent->" & Data )
End Sub
By my understanding, each of the above should produce the same result. The first version is the easiest to follow, but the last is the most terse.