vfafou Well-Known Member Licensed User Longtime User Aug 19, 2020 #1 Hello! I would like to ask the following questions: According to this post: https://www.b4x.com/android/forum/threads/b4xpages-shared-constants.121269/ we can access globals from any B4XPages app modules. If we write: B4X: Sub Process_Globals End Sub Sub Service_Create Public AppGlobals As clsGlobals AppGlobals.Initialize B4XPages.GlobalContext = AppGlobals End Sub then we don't have access from other modules. it may be: B4X: Sub Process_Globals Public AppGlobals As clsGlobals End Sub Sub Service_Create AppGlobals.Initialize B4XPages.GlobalContext = AppGlobals End Sub If this is not right, how do we access the AppGlobals from any other modules? Thank you in advance.
Hello! I would like to ask the following questions: According to this post: https://www.b4x.com/android/forum/threads/b4xpages-shared-constants.121269/ we can access globals from any B4XPages app modules. If we write: B4X: Sub Process_Globals End Sub Sub Service_Create Public AppGlobals As clsGlobals AppGlobals.Initialize B4XPages.GlobalContext = AppGlobals End Sub then we don't have access from other modules. it may be: B4X: Sub Process_Globals Public AppGlobals As clsGlobals End Sub Sub Service_Create AppGlobals.Initialize B4XPages.GlobalContext = AppGlobals End Sub If this is not right, how do we access the AppGlobals from any other modules? Thank you in advance.
Erel B4X founder Staff member Licensed User Longtime User Aug 19, 2020 #2 Starter service: B4X: Sub Service_Create Dim AppGlobals As clsGlobals AppGlobals.Initialize B4XPages.GlobalContext = AppGlobals End Sub Any place you like: B4X: Dim cg As clsGlobals = B4XPages.GlobalContext Upvote 0
Starter service: B4X: Sub Service_Create Dim AppGlobals As clsGlobals AppGlobals.Initialize B4XPages.GlobalContext = AppGlobals End Sub Any place you like: B4X: Dim cg As clsGlobals = B4XPages.GlobalContext