Re: PBHGEN - PureBasic Header Generator
Posted: Sat Jun 04, 2016 4:28 pm
Hi Tristano, no it uses compiler directives to load the appropriate define lines. It used to make multiple files but that's an old version.
CompilerIf #PB_Compiler_Module = ""
Declare NormalEmptyProcedure()
Declare BracketStuff(String$ = "heh" + Chr(50), Okay.l = 50)
CompilerEndIf
CompilerIf #PB_Compiler_Module = "TestA"
Declare Func1()
Declare Func2()
Declare A()
CompilerEndIf
Outside of any module the first condition will be true (#PB_Compiler_Module = ""). Inside of module TestA the second condition will be true (CompilerIf #PB_Compiler_Module = "TestA"). This separates the code that will be included into any portion of your program. You have two options, either you make everything inside of your module public (which doesn't work well with PureBasic's code suggestions which is why it's nearly impossible to make this an automated feature as it only adds confusion):Or you use it like usual, inside of the module itself (to make any procedures not mentioned in the DeclareModule statement accessible from anywhere):
As for automatically adding inclusion lines into the source, that's likely not going to be happening, mainly because some people may prefer the additional control over when what gets included and because the IDE will continue to ask whether to reload the file whenever it's modified externally.
CompilerIf #PB_Compiler_Module = ""
Declare NormalEmptyProcedure()
Declare BracketStuff(String$ = "heh" + Chr(50), Okay.l = 50)
CompilerEndIf
CompilerIf #PB_Compiler_Module = "TestA"
Declare Func1()
Declare Func2()
Declare A()
CompilerEndIf
Outside of any module the first condition will be true (#PB_Compiler_Module = ""). Inside of module TestA the second condition will be true (CompilerIf #PB_Compiler_Module = "TestA"). This separates the code that will be included into any portion of your program. You have two options, either you make everything inside of your module public (which doesn't work well with PureBasic's code suggestions which is why it's nearly impossible to make this an automated feature as it only adds confusion):
Code: Select all
DeclareModule TestA
IncludeFile #PB_Compiler_File + "i" ;- PBHGEN
EndDeclareModule
Code: Select all
DeclareModule TestA
Declare A()
EndDeclareModule
Module TestA
IncludeFile #PB_Compiler_File + "i" ;- PBHGEN
Procedure A()
B()
EndProcedure
Procedure B()
Debug "Works"
EndProcedure
EndModule