Android Question dim vs private

edm68

Member
Licensed User
Longtime User
I hate to ask such a noob question, but what is the difference between dim & private?
I searched the forum but couldn't find. Just updated to 3.20 and noticed after using Designer-Tools-Generate members it uses Private for spinners,buttons,etc. Before it would use dim. Going from examples I've used dim in Sub Process_Globals, Sub Globals, and my private subs. I haven't advanced to using other modules yet, so I don't know if that matters.
As a test I just put variables in all three and test compiled and it was successful. So I guess I'm asking when is the time to use each one?
Thanks
 

edm68

Member
Licensed User
Longtime User
Thanks Luca & rayzrocket,
I just don't understand I guess. I thought anything that was dim in Process_Globals was pretty much public and available to other modules anyways. And anything dim in Globals was limited to that module? And anything dim in sub was limited to that sub?
I'm probably just overthinking and need to try again tomorrow after more thought.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I thought anything that was dim in Process_Globals was pretty much public and available to other modules anyways. And anything dim in Globals was limited to that module? And anything dim in sub was limited to that sub?
1. You can make it private with the Private scope modifier.
2. This is correct.
3. This is also correct.
 
Upvote 0
Top