PBHGEN collects all the comments from the source file and place them in .pbi file (with the same name as source file), then creates the declarations (Declare) and also put them in the same .pbi file, after comments, which are transfered earlier.
Actually it parses the Source File line by line, comments will only be copied on lines where the first character is a ; (semicolon).
; This Procedure will cause the application to crash.
N.i = 0
; PureBasic would detect / 0 with an error message.
ProcedureReturn 5 / N
This was done to ensure other comments that are used inside of procedures aren't copied. Where those comments are mostly for forums or easy reference etc. they don't have any real purpose for the programmer.
PBHGEN do not automatically open newly made the .pbi file: the user should find it in proper directory and open it (by double click in directory for example) to see in PureBasic Editor.
True, and I don't see any reason why you would want to open it, every time you save the source file it builds a new header file. Their main purpose is to allow you to seamlessly write procedures below the calls to them which adds allot of flexibility. You would only get allot of "The file you are editing has been modified, would you like to reload it?" messages.
You have to include the header into your source file using:
XIncludeFile #PB_Compiler_File + "i" ;- PBHGEN
I hope this answered your questions, if there is anything else I can do feel free to ask!