Bug? Public String variables can't be Assignment

jiuciyu_2008

Member
Licensed User
Longtime User
I got this error when compile my code:

B4R version: 1.20
Parsing code. (0.00s)
Compiling code. Error
Error compiling program.
Error description: Cannot set a Const variable (global non-primitive variables are always constants).
Occurred on line: 19
s1="123456"
Word: =

And the code is:
B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Public s1 As String
End Sub

Private Sub AppStart
    s1="123456"
    Serial1.Initialize(115200)
    hardstream.Initialize(Serial1.Stream,"hardstream_NewData",Null)
End Sub
 
Top