Dbasic crashes on bad code

agraham

Expert
Licensed User
If you have a global variable and a sub of the same name and reference the variable in the sub then Dbasic crashes without emitting a warning.

B4X:
Sub Globals
   'Declare the global variables here.
   fred = true
End Sub

Sub App_Start
   Form1.Show
End Sub

Sub fred
   fred = true
End Sub
This had me panicking for a while - the code that started doing it to me was not quite as straightforward as the fragment above that I distilled the problem down to.
 
Top