Page 3 of 3

Re: PBHGEN - PureBasic Header Generator

Posted: Sat Jun 04, 2016 4:28 pm
by Henry00
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):

Code: Select all

DeclareModule TestA
  IncludeFile #PB_Compiler_File + "i" ;- PBHGEN
EndDeclareModule
Or you use it like usual, inside of the module itself (to make any procedures not mentioned in the DeclareModule statement accessible from anywhere):

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
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.

Re: PBHGEN - PureBasic Header Generator

Posted: Tue Mar 19, 2019 10:57 am
by Henry00
I have updated the broken links in the first post. The project is now open source on GitHub as well: https://github.com/00laboratories/PBHGEN
It's great to see that this project continues to help a lot people. As always be sure to let me know if there's any new PureBasic syntax that breaks things! :)

Re: PBHGEN - PureBasic Header Generator

Posted: Sun Sep 29, 2019 4:18 pm
by Henry00
Version 5.71
Fixed double colon operator inside procedure arguments OnVstMain(*Effect.Vst2::AEffect).

Re: PBHGEN - PureBasic Header Generator

Posted: Wed May 13, 2020 10:17 pm
by TRS-Eric
This tool is a must have for purebasic. Thanks!

Re: PBHGEN - PureBasic Header Generator

Posted: Thu May 14, 2020 12:36 pm
by Henry00
Version 5.72
Fixed runtime keyword not getting detected properly.
TRS-Eric wrote:This tool is a must have for purebasic. Thanks!
And thank you Eric for providing the fix above, I am glad you like it! :)

Re: PBHGEN - PureBasic Header Generator

Posted: Fri Mar 05, 2021 9:36 am
by Henry00
Version 5.73
Removed the timestamp and version info in generated headers to make them git-friendly.
Removed ambiguous licensing terms at GitHub (it's MIT).