Possible Bug: Local variable affects Class public variable if same name

qsrtech

Active Member
Licensed User
Longtime User
Hi, I think I might have found a little bug.

Given something like this:

B4X:
'AClass
Sub Class_Globals
Public MyParent as AClass=Null
End Sub
...

'after this sub is called, the Classes public MyParent seems to be also affected
'cause when I test MyClass.MyParent=Null it is always false after this sub is called
sub DoSomething(ID as int)
dim MyParent as AClass'only has to be dimmed, doesn't even have to be used
End sub
 
Last edited:

qsrtech

Active Member
Licensed User
Longtime User
duplicate variable names

Hmm, must be java/android specific cause the local variable (if same name as global ones) takes precedent in any other language I've used. I'll have to be more careful moving forward cause this issue caused a fair bit of delay.
 
Top