How do you use Code Modules?

PharCyDeD

Active Member
Licensed User
Longtime User
When I create a new code module it says the code will be accessible to all modules. However, I do not understand how to use it. If I place code in there...how do I call it from other modules like 'Main'? I would like to make modules with certain code that can be re-used for other things, but I am unsure of how to actually use the modules.
 

NJDude

Expert
Licensed User
Longtime User
A code module as you stated is available to all the activities, you use a prefix to call it, for example, let's say you have a Module named: SayHello and this code in it:
B4X:
Sub SayHi

    MsgBox("Hello from Module", "")

End Sub

So, from any other activity you call it like this:
B4X:
SayHello.SayHi
 
Upvote 0
Top