What is the difference between Process Globals and Globals?

fdx12345

Active Member
Licensed User
Longtime User
I know about globals and how to use them in other languages but in Basic4Andriod, what is the difference between the Sub Process_Globals vs just Sub_Globals?

Bill
 

HimeAnator

Member
Licensed User
Longtime User
Sorry to revive an old topic but I had a question regarding Process Globals and I felt it would fit in here.

If I declare a Process Global in the main activity and then close the main activity to open a new one, then is the Process Global still accessible? Or does it die since I closed the activity that created it?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
No.
Variables declared in Globals have the same lifecycle as the Activity where they were declared.
Valiables declared in Process_Globals (in any Activity module) are accessible from all other activities, but need to have, in other modules, as a prefix the module name where they were declared.
Example variable declared in Main:
In the Main module
MyVariable = 10
In any other module
Main.MyVariable = 10

Best regards.
 
Upvote 0
Top