_mandy New Member Nov 9, 2021 #1 Hello, first post in any forums. So basically I have a global variable of sql on B4XMainPage class, my idea is that once the application opens, the sql database is loaded in public and can be called by different classes upon their initialization. This is so I could prevent it from locking somehow. In my app, the B4XMainPage will house the Login page, then the SecondPage is the actual "Main Page" Code: Copy Sub Class_Globals Private Root As B4XView Private xui As XUI Public sql1 As SQL Dim pageSecond As SecondPage End Sub My question now is what happens to the B4XMainPage's public variables when i call B4XPages.ShowPageAndRemovePreviousPages("second page"). Do those get destroyed later on? Thanks and more power!
Hello, first post in any forums. So basically I have a global variable of sql on B4XMainPage class, my idea is that once the application opens, the sql database is loaded in public and can be called by different classes upon their initialization. This is so I could prevent it from locking somehow. In my app, the B4XMainPage will house the Login page, then the SecondPage is the actual "Main Page" Code: Copy Sub Class_Globals Private Root As B4XView Private xui As XUI Public sql1 As SQL Dim pageSecond As SecondPage End Sub My question now is what happens to the B4XMainPage's public variables when i call B4XPages.ShowPageAndRemovePreviousPages("second page"). Do those get destroyed later on? Thanks and more power!
LucaMs Expert Licensed User Longtime User Nov 9, 2021 #2 _mandy said: Do those get destroyed later on? Click to expand... No. _mandy said: So basically I have a global variable of sql on B4XMainPage class, my idea is that once the application opens, the sql database is loaded in public and can be called by different classes upon their initialization. Click to expand... Good solution, although a specific database management class would be even better. You could create a public instance (= object = variable) of this class in the B4XMainPage or in a code module. Upvote 2
_mandy said: Do those get destroyed later on? Click to expand... No. _mandy said: So basically I have a global variable of sql on B4XMainPage class, my idea is that once the application opens, the sql database is loaded in public and can be called by different classes upon their initialization. Click to expand... Good solution, although a specific database management class would be even better. You could create a public instance (= object = variable) of this class in the B4XMainPage or in a code module.