Android Question How Do I Declare a List or Array that's Available App-Wide?

Shadow&Max

Active Member
Licensed User
Longtime User
I want to declare several lists and arrays that are available to every sub, form or module in the app. is that possible? I have used the search feature, but it's not really the most accurate and I haven't found what I needed... I read about variables, but it still isn't clear.

Can I declare an array, for example, which the entire app can use, and if so, where and how do I declare that?

If I want to write a sub that's available to everything, does it go in a class module or a code module?

I know these are basic Basic things, but I've been out of the loop for a while and am definitely rusty.

Any help would be appreciated...

Thanks in advance...
 

LucaMs

Expert
Licensed User
Longtime User
You can (and should) use a code module for global routines and "data" (variables, arrays, lists...); an example: DBUtils.

Activities and classes can share their variables (and lists, etc.) too and you can call their routines, but for global purpose is better to use code modules.
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Thanks... OK, again trying to not sound stupid...

Say I've got the modules main, second and general, and general is a code module I just created.

I moved the declarations of the lists, arrays and variables I want totally global to that.

However, in the modules that also use those arrays (main and second), lists and variables other than in the "general" code module, they're all red and error out as undeclared, so they don't seem very "global."

What the heck am I missing here?
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Thanks again... That helped... the subs are executing correctly, but something now in Erel's KeyListStore is no longer working, and I can't figure out why... I'll hack away at it for a few hours and I'll get it fixed... thanks!
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Got it figured out... was a big help, thanks!
 
Upvote 0
Top