Hi, Guys
I am having a problem - I am using B4X pages and have setup an object to store information used by may classes and pages in my application.
In the App this global object (with a public attribute) resides in the B4XMainPage, however when testing is can reside elsewhere.
So I have tried to pass a reference of this object in various calls to pages/classes, attempting to avoid using explicit code like
B4XPages.MainPage.ObjectName.ElementName = newDate (i.e. when testing it can reside in one of the test modules).
Unfortunately, using a reference does not update the global object (it appears to only update a local copy of the object) - the explicit code does however work.
I have used this method of passing a reference to an object in other languages and it works well, and by not using explicit code to access a fixed global object makes the classes more re-usable and easier to test.
I hope you can understand my question, if so what I am doing wrong?
Dave Morris
I am having a problem - I am using B4X pages and have setup an object to store information used by may classes and pages in my application.
In the App this global object (with a public attribute) resides in the B4XMainPage, however when testing is can reside elsewhere.
So I have tried to pass a reference of this object in various calls to pages/classes, attempting to avoid using explicit code like
B4XPages.MainPage.ObjectName.ElementName = newDate (i.e. when testing it can reside in one of the test modules).
Unfortunately, using a reference does not update the global object (it appears to only update a local copy of the object) - the explicit code does however work.
I have used this method of passing a reference to an object in other languages and it works well, and by not using explicit code to access a fixed global object makes the classes more re-usable and easier to test.
I hope you can understand my question, if so what I am doing wrong?
Dave Morris