News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Hex file with custom name

Started by Amateurtje, May 16, 2024, 08:22 AM

Previous topic - Next topic

Amateurtje

Hello,

I use the ProtonIDE, which I am used to. I do not know if this is a program or compiler issue..
I have a script with some $Ifdef statements inside for programming different versions of the same script. This works nicely.

The only thing is that it overwrites all the time the same Hex file. It would be nice to have something like:

$ifdef colorgreen
 hexFilename= "DisplayscriptV1.2.2 - Color Green.hex "
$endif
$ifdef colorRed
 hexFilename= "DisplayscriptV1.2.2 - Color Red.hex "
$endif
$ifdef colorBlue
 hexFilename= "DisplayscriptV1.2.2 - Color Blue.hex "
$endif
$ifdef colorBlack
 hexFilename= "DisplayscriptV1.2.2 - Color Black.hex "
$endif

IS there a way to define the output hex filename as a different custom filename instead of the bas filename? 
It would already save a lot of time in renaming and deleting but also less chance of doing something wrong.

Ultimate wish:
Even better would be that in 1 compile run it outputs all files but that is probably a bit too much  ;D . During testing it takes maybe too much time but that you can also set that... With 1 setting a kind of output all for outputitng all files at the end of the day ..

Anybody a good solution for this?

JohnB

You could write a script file which compiles the current source file and after compilation renames the output file.
Alternatively, if you are using the ProtonIDE and are in to VB or Delphi you can write a plugin to do exactly what you are asking.
JohnB

Amateurtje

#2
Hi John, good idea. I never done this and at the moment another project is a bit much... But for the future I hope to get some time.. These kind of ideas only come when you do not have the time :).

PS, I do a lot in vb.net.. is there an example fo how to make this?

keytapper

If I understand correctly there's a option on multiple rename.
You may find a multiple rename utility that will do the job.
Ignorance comes with a cost

Amateurtje

that tool can not know which definitions were on and off, when making the hex, I assume...

So I think this is not really usable....

JohnB

@Amateurtje I don't have any examples using VB, I program primarily in Delphi.  Others on the site have written  plugins using VB.  On the old site there were some examples, I don't know how many if any got transferred.  I am considering an Automation plug in to Positron Studio which could be configured to do something like this but this is not going to be a priority for some time.
JohnB

Amateurtje

Hi John,

Would be a good thing.. I installed Positron Studio also and it can do ofcourse a lot more but I need to take a little bit of time to get more familiar with it... And you know how it goes, you double click the bas and it still opens ProtonIDE :), and it feels familiar...
But I should start using your much more beatiful software. Like for the unused variables etc, it is soo much more logical... :)

Stephen Moss

Not the solution you are looking for but for now in the folder where the .hex file is produced you could create folders for the different versions, compile for version A and move the resulting hex file into the relevant folder, then repeat for the other versions. It would at least save you from having to rename the .hex files