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