B4R Question Modify Global variable from a sub not possible?

KMatle

Expert
Licensed User
Longtime User
I have defined a variable in Process_Globals (ESP32 program)

B4X:
Public iv(16) As Byte

I wondered why I'm not able to change it from a sub via ArrayCopy. Via Inline C I can do it.

For a test I tried to modify the first byte

B4X:
iv(0)=99
Log("IV(0)",iv(0))

It works in

B4X:
Private Sub AppStart

but not in any other sub. Any ideas?
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…