Common code for multiple macros

  • 1
  • Question
  • Updated 6 months 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 6 months ago

  • 1
Photo of Nick Duffill

Nick Duffill, Champion

  • 527 Posts
  • 178 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.