Hello:
I have been working on a project with B4A v1.70. Upon installing v1.80 yesterday, I had noticed that I was receiving compiler errors upon the assignment of "" to a string declared in the Process_Globals section of my code. v1.70 compiled a similar program error free. I put together a little test program with comments indicating what and what does not work. The assignment of "" to a string maybe totally wrong but I use it on occasion to put variable in some known state before use. The source code is below . I have also attached a .zip file of the test program and a screen capture of the error message I receive on my end of the world.
I hope this helps.
thx,
Ray
I have been working on a project with B4A v1.70. Upon installing v1.80 yesterday, I had noticed that I was receiving compiler errors upon the assignment of "" to a string declared in the Process_Globals section of my code. v1.70 compiled a similar program error free. I put together a little test program with comments indicating what and what does not work. The assignment of "" to a string maybe totally wrong but I use it on occasion to put variable in some known state before use. The source code is below . I have also attached a .zip file of the test program and a screen capture of the error message I receive on my end of the world.
I hope this helps.
thx,
Ray
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'NOTE: the assignment statements below generate a compiler error
Dim TestString1 As String : TestString1 = "" ' declaration and assignment to NULL (comment out and OK)
Dim Teststring2 As String ' declaration only
Teststring2 = "" ' assignment to NULL on separate line generates an error
' comment this out and OK
Dim TestString4 As String : TestString4 = "abc" ' this is OK
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim TestString5 As String: TestString5 = "" 'this is OK
End Sub
Sub Activity_Create(FirstTime As Boolean)
'
Dim TestString6 As String: TestString6 = "" ' this DOES NOT generate a compiler error
'
'
Teststring2 = "" ' this is OK '
TestString5= "" ' this is OK
End Sub
Attachments
Last edited: