Hi,
I have developed a full-fledged application while learning b4A with all my Public Modules in Starter.bas and multiple B4XPages accessing them.
Details are as under:-
1) My application has multiple B4XPages.
2) Each B4Page has variables declared as Private in its Class_Globals for use in various Subroutines written inside that B4XPage, which are Private to that particular B4XPage.
3) However, my Service Module Starter.bas contains all the code related to my Public database functions which I have declared as Public and which is for sharing across ALL B4XPages of my application.
I reference my Public functions in Starter.bas in all my b4xPages as Starter.dbFunction1(), Starter.dbFunction2() etc. and it works perfectly.
4) Now, in order to segregate all my Application specific Database Public functions, I tried to move them by creating a separate class and putting them there.
But I am unable to reference the Public Functions from my B4XPages
by <className>.dbFunction1() .
My question is:
1) Which is the right place to open and close a database connection.
Presently I am doing that in Starter.bas.
2) How should one organize the various functions into classes and reference them with the <className>.<functionName>.
Sorry if I sound too basic.
Thanks
I have developed a full-fledged application while learning b4A with all my Public Modules in Starter.bas and multiple B4XPages accessing them.
Details are as under:-
1) My application has multiple B4XPages.
2) Each B4Page has variables declared as Private in its Class_Globals for use in various Subroutines written inside that B4XPage, which are Private to that particular B4XPage.
3) However, my Service Module Starter.bas contains all the code related to my Public database functions which I have declared as Public and which is for sharing across ALL B4XPages of my application.
I reference my Public functions in Starter.bas in all my b4xPages as Starter.dbFunction1(), Starter.dbFunction2() etc. and it works perfectly.
4) Now, in order to segregate all my Application specific Database Public functions, I tried to move them by creating a separate class and putting them there.
But I am unable to reference the Public Functions from my B4XPages
by <className>.dbFunction1() .
My question is:
1) Which is the right place to open and close a database connection.
Presently I am doing that in Starter.bas.
2) How should one organize the various functions into classes and reference them with the <className>.<functionName>.
Sorry if I sound too basic.
Thanks
Last edited: