Autoexecute tool(s) at compile command

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 670
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Autoexecute tool(s) at compile command

Post by Kurzer »

A suggestion to improve the project panel and the compile functionality.

It would be fine, if we could assign one ore more 'tools' (from the tools menu) to a single project file.
Why this?

The tool should be executed automatically if the user hits F5 or press the compile button and then the tool should run before the PB compiler is doing it's work.

So the user can assign a preprocessor for example to the maincode of his project.

Without this feature he first have to activate the editortab with the corresponding sourcefile, then execute the preprocessor-tool manually and at last he have to press the compile button.

The tool-execution should work like a manual excution from the tools menu - inclusive the %FILE Parameter etc.
And if possible, the user could assign more than one tools to a sourcfile (like a chain).

Example visualisation:

Code: Select all

Projekt "MyProject"
Projectfiles                  Assigned Tools

- Main.pb ------------------> Preprocessor Tool 1 --> Preprocessor Tool 2
- Network.pb
- Settings.pb --------------> Preprocessor Tool 3
So if the user hit 'compile' the following should happen:

1) Start Preprocessor Tool 1 (%FILE parameter points to Main.pb)
2) Start Preprocessor Tool 2 (%FILE parameter points to Main.pb)
3) Start Preprocessor Tool 3 (%FILE parameter points to Settings.pb)
4) Start the PB Compile process

If you wonder which preprocessors I am talking about. I mean for example 'Editor-linebreak-preprocessors' or 'automatic procedure declaration-preprocessors' etc...

Sorry for my godawful description - I hope you understand my suggestion... I am so tired at the moment and my english is generally not the best. ;)
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Autoexecute tool(s) at compile command

Post by blueznl »

That is already possible. Look for the 'triggers' in the 'tools' menu in the IDE. I'm using those for CodeCaddy as well. Or isn't that what you were looking for?

Currently, there's just one tool launchable, but I believe it may be possible to tie in multiple, just didn't have time to explore in that direction.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 670
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Autoexecute tool(s) at compile command

Post by Kurzer »

Hello Blueznl,
thank you for this information. I didn't know that feature detailed (shame on me), I use the tools only with shortcut.

I will check it this evening.

I hope it is possible to set the "input sourcecode" which is defined in the project options) as %FILE parameter for the tool.

My problem now is, I have to switch back to the "main sourcecode" of my project each time before I can execute the preprocessor tool.
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 670
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: Autoexecute tool(s) at compile command

Post by Kurzer »

Now I had a deeper view on it.

You're right Blueznl, I can use the preprocessor tool with option 'before compiler starts' and parameter %COMPILEFILE
Maybe this works for more than one tools with same trigger settings to set up a preprocessor chain. But this tools would always be started - for every code. Even for code that is not suitable for some of the preprocessors.

If I could assign different tools depending on the project, it would be more flexible.

But its of course only a 'nice to have' - I don't think I'm going to get tendinitis, just because I always have to press a shortcut. :lol:
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
Post Reply