Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Dim bc As ByteConverter
Dim b() As Byte = bc.Trim("abcdef ")
b(0) = Asc("M") 'this line will change the value of the literal string
Log("b length = ",b.Length)
Dim s As String = "abcdef "
Log(s) 'Mbcdef
Log("abcdef ") '???
For i = 0 To b.Length - 1
Log("b.",i," = ",b(i))
Next
Dim d As String
d = bc.StringFromBytes(b)
Log("d length = ", d.Length)
For i = 0 To d.Length -1
' this next line messes the Arduino up completly
' Log("d = ",bc.SubString2(d,i,1))
' this line works as expected
Log("d = ",bc.SubString(d,i))
Next
End Sub