Common code for multiple macros

  • 1
  • Question
  • Updated 2 years ago
I'm writing a few macros that do different tasks but require some common code. These are for example some functions for reading and writing data to and from text files. I have created a .mmbas file for each macro but can't find a way to call the same function or subroutine from different .mmbas files. Is this possible in some way, or are there good ways around this problem?
Photo of Gunnar Snær Gunnarsson

Gunnar Snær Gunnarsson

  • 1 Post
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Nick Duffill

Nick Duffill, Champion

  • 604 Posts
  • 248 Reply Likes
Hello Gunnar

Yes, there is an "#Uses" directive that allows you to include content in other files. You will have to play around with the order in which things are declared. If you go to the language help for WWB-COM, the #Uses directive is documented.