V 1.2 Code Module

Rusty

Well-Known Member
Licensed User
Longtime User
It appears that the Process_Globals and Globals are not available in the Code Modules without qualifying them with "Main" (i.e. Main.variablename)
Is this correct or am I doing something wrong? Are code Modules as efficient as leaving code in mainline? Can these code modules be reused by other applications without having to copy the code into the other project? (in other words, can the code exist in only one place for maintenance, but be used by many apps/projects?)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
In order to access variables in other modules you should use the module prefix. Main in the case of the main activity. Note that you can only access Process Globals variables.

There is no performance penalty in using code modules.

When you add an existing module it is copied to the local folder. You cannot reference the same file from two projects. I think that in most cases this is better than referencing the file, as you may do a small change in one project and break a different project.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks, Erel.
I was thinking in terms of general use code that in a VS environment might be a class that is reusable. I understand your approach and can work with it. BTW, I like the services modules :)
 
Upvote 0
Top