I have read the beginners guide to using the designer, but I don't understand how to use the variables in my code.
For example, in the designer I make a label called Lab2.
Then in my code
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("mg_layout001")
.
.
and I have a sub routine
Sub usocket_PacketArrived (uu As UDPPacket)
Dim msg As String
msg = BytesToString(uu.Data, uu.Offset, uu.Length, "UTF8")
Lab2.Text = " " & msg.Replace("Temp=", "Temperature =") & Chr(176) & "C"
' Msgbox("Message received: " & msg, "") ' works ok
End Sub
But I get an error that Lab2 is not declared. If I don't refer to the variable Lab2 then the label appears as it should.
Can someone point me to the documentation which explains what I should do please? (As far as I understand it the introduction doesn't explain this.)
This is my first attempt at B4A so don't be too hard on me yet!
For example, in the designer I make a label called Lab2.
Then in my code
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("mg_layout001")
.
.
and I have a sub routine
Sub usocket_PacketArrived (uu As UDPPacket)
Dim msg As String
msg = BytesToString(uu.Data, uu.Offset, uu.Length, "UTF8")
Lab2.Text = " " & msg.Replace("Temp=", "Temperature =") & Chr(176) & "C"
' Msgbox("Message received: " & msg, "") ' works ok
End Sub
But I get an error that Lab2 is not declared. If I don't refer to the variable Lab2 then the label appears as it should.
Can someone point me to the documentation which explains what I should do please? (As far as I understand it the introduction doesn't explain this.)
This is my first attempt at B4A so don't be too hard on me yet!