It would be nice to standardize on a file extension (ie: .pbm for purebasic module)
And when you issue UseModule MyModule
if mymodule is not already defined, the compiler looks for a file "MyModule.pbm" and includes it auto-magically, before actually acting on the "useModule" command.
Autoload Modules
Re: Autoload Modules
Could you compile a macro as resident file, so you can use that feature now?jassing wrote:It would be nice to standardize on a file extension (ie: .pbm for purebasic module)
And when you issue UseModule MyModule
if mymodule is not already defined, the compiler looks for a file "MyModule.pbm" and includes it auto-magically, before actually acting on the "useModule" command.
Code: Select all
Macro DQ
"
EndMacro
Macro ImportModule(name) ; include and use module
XIncludeFile #PB_Compiler_Home + "modules/" + DQ#name#DQ + ".pbm"
UseModule name
EndMacro
Macro LoadModule(name) ; include module
XIncludeFile #PB_Compiler_Home + "modules/" + DQ#name#DQ + ".pbm"
EndMacro
Macro Include(name) ; include .pbi
XIncludeFile #PB_Compiler_Home + "includes/" + DQ#name#DQ + ".pbi"
EndMacro
ImportModule(fileModule)
LoadModule(windowModule)
Include(gDrawing)
Re: Autoload Modules
@Danilo: Thanks for this macro. 
