How do I create a global function in Xojo? I inserted a module. Can I just write the global function as a new method in the module?
Yup!
Thanks, Marc!
Be careful with global functions. First, consider if it really should be global. Second, it’s better to set these up a Protected instead of Public functions to guard against conflicts with the name if you ever import code, and to encapsulate the code. If your module is called “MyModule”, a Public function “Something” could be called as Something()
whereas Protected would have to be called as MyModule.Something()
.