Page 4 of 4

Re: [IDE Tool] pbOptimizer

Posted: Sun Apr 25, 2021 5:59 pm
by chi
updated to v0.9.8.9


@ChrisR
Issue 1: Could you please send me a little snippet showing the exact problem? I can't reproduce this error on my side.
Issue 2: The problem is that PB removes the IncludePath when compiling with the /PREPROCESS switch. I'm pretty sure that's a bug (bug report incoming). Meanwhile, the only way around this is to disable "Create .pb" in the settings window (v0.9.8.9).

@loulou2522
Must be a false positive, for sure... I just tested the new version on VirusTotal with 3/68
Please send me the problematic .rc file, so I can see what's going on... Thank you!

Re: [IDE Tool] pbOptimizer

Posted: Sun Apr 25, 2021 6:57 pm
by ChrisR
chi wrote: Sun Apr 25, 2021 5:59 pm Could you please send me a little snippet showing the exact problem? I can't reproduce this error on my side.
You can reproduce with the Jsave.pbi module from here
And this piece of code

Code: Select all

Structure Struct
  Gadget.i
  Name.s
EndStructure
Global NewList ListStruct.Struct()

XIncludeFile "JSave.pbi"

Define sFilePath.s =  GetCurrentDirectory() + "Test.json"
If CreateJSON(0)
  InsertJSONList(JSONValue(0), ListStruct())
  JSave::InitObjectStr("", "Gadget, Name")
  JSave::Save(0, sFilePath)
  FreeJSON(0)
EndIf
For the 2nd case, I copied the contents of the "Images" folder to the root, it compiles but it's not ideal :wink:
Thanks for the new version, not yet tested

Re: [IDE Tool] pbOptimizer

Posted: Sun Apr 25, 2021 8:02 pm
by chi
@ChrisR
Thanks for the code! It is pretty easy to fix, just remove 1 space char between LoadOrder and ( from: Declare.i LoadOrder (prefFile$) inside JSave.pbi and it works. I wasn't expecting more than 1 space char after the procedure name (I mean, who would do that??? :lol:). Will be fixed soon!
ChrisR wrote: Sun Apr 25, 2021 6:57 pm For the 2nd case, I copied the contents of the "Images" folder to the root, it compiles but it's not ideal
You can leave "Create .pb" unchecked and get the same result as if it is checked. All I'm doing here is saving the source code with all includes into a single file and removing resolved macros and uncalled procedures, which PB will automatically remove in the next step when the .asm file is created. "Create .pb" is therefore only useful if you want to have a clean and slick version of your .pb file (but it seems to make the biggest problems ;)).

Re: [IDE Tool] pbOptimizer

Posted: Sun Apr 25, 2021 9:12 pm
by ChrisR
You were fast
chi wrote: Sun Apr 25, 2021 8:02 pm (I mean, who would do that??? :lol:). Will be fixed soon!
Probably someone who has fun with these Little spaces :lol:

Thank you for the explanation on "Create .pb".
Maybe in case of error at compile time you could ask to continue from the original source.

Re: [IDE Tool] pbOptimizer

Posted: Sun Apr 25, 2021 9:25 pm
by chi
ChrisR wrote: Sun Apr 25, 2021 9:12 pm Thank you for the explanation on "Create .pb".
Maybe in case of error at compile time you could ask to continue from the original source.
You're welcome ^^. I should probably do something like that, or give a better description somewhere in the settings...

Re: [IDE Tool] pbOptimizer

Posted: Mon Apr 26, 2021 4:25 pm
by chi
updated to v0.9.8.10

This update should fix all problems with Constants, Version Info and RC files...

Re: [IDE Tool] pbOptimizer

Posted: Fri Apr 30, 2021 8:34 am
by loulou2522
Thanks Chi,
Great Programm; I work with PBOPTIMIZER for a project of more than 64000 lines.
Result: The program runs normally, with less memory consumption and a slightly reduced executable size
I advise all Purebasic programmers with large projects to use "PBOPTIMIZER".
Cheers,

Re: [IDE Tool] pbOptimizer

Posted: Fri Apr 30, 2021 9:45 am
by chi
Hehe, thanks for the nice review, loulou!
And thanks for finally getting me to correct the version info section. In retrospect, I don't know why I hesitated so long :)