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
Public timer1 As Timer
Public byteconv As ByteConverter
Public count As Int 'Counter in Timer1
Dim strlength As Int 'Length of destination String
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
timer1.Initialize("Timer1_Tick",1000)
timer1.Enabled=True
End Sub
Sub Timer1_Tick
count=count+1
Dim str1 As String="Counting: " 'string1 to concatenate
Dim str2 As String=count 'with string2
strlength=str1.Length+str2.Length 'Length of destination String
Dim bytes(strlength) As Byte
byteconv.ArrayCopy(str1.getbytes,0,bytes,0,str1.Length)
byteconv.ArrayCopy(str2.GetBytes,0,bytes,str1.Length,str2.Length)
Log(bytes) 'concatenated "string" of string1 & string2
End Sub