Is it possible to write to project file with external tool?

Working on new editor enhancements?
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Is it possible to write to project file with external tool?

Post by helpy »

Hello,

probably this can only be answered by Purebasic team:

An external tool can get full path and filename of currently loaded project file with the environment variable PB_TOOL_Project.
Is it possible to change the project file with external tool?

I want to save own project specific information inside the pbp file, similar to the following code:

Code: Select all

<project xmlns="http://www.purebasic.com/namespace" version="1.0" creator="PureBasic 5.40 LTS Beta 3 (Windows - x64)">
  <section name="config">
    <options closefiles="1" openmode="2" name="project-name"/>
  </section>
  ...
  <section name="externalTool:information">
    ...
  </section>
</project>
Does the IDE allow this?

Thank you for the information,
guido
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: Is it possible to write to project file with external to

Post by helpy »

OK!

I tested it myself.
It is possible to write own data to pbp file, but it will be overwritten with the pbp contents, which was already loaded by the IDE, after closing the project or exiting the IDE.

This means: it is not possible to use the pbp file to save own project specific data.
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Is it possible to write to project file with external to

Post by c4s »

I think a workaround might be to put your data into the project's comment section ("Project Options" -> "Comments").
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: Is it possible to write to project file with external to

Post by helpy »

c4s wrote:I think a workaround might be to put your data into the project's comment section ("Project Options" -> "Comments").
Thank you for your hint.

I was searching a way to add user specific project options to pbp file with an "external IDE Tool" (Tools -> Configure Tools...)!
I do not want to write it by my own in to the comment section!

I think the best way is to create a new file for my user specific project settings based on the project file name!
==> project file: /path/to/project/file/project.pbp
==> user specific project file: /path/to/project/file/project.pbp.user
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Is it possible to write to project file with external to

Post by c4s »

helpy wrote:I was searching a way to add user specific project options to pbp file with an "external IDE Tool" (Tools -> Configure Tools...)!
I do not want to write it by my own in to the comment section!
That's what I meant. Isn't it possible to write into the comment section of the project file after the file has been updated by the IDE?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: Is it possible to write to project file with external to

Post by helpy »

c4s wrote:
helpy wrote:I was searching a way to add user specific project options to pbp file with an "external IDE Tool" (Tools -> Configure Tools...)!
I do not want to write it by my own in to the comment section!
That's what I meant. Isn't it possible to write into the comment section of the project file after the file has been updated by the IDE?
I was writing to the xml file (created a complete new section there).
==> If the project is closed or the IDE is closed, the IDE overwrites the pbp with its own preloaded version!

The same would happen if i write the comment in to the pbp file!

But I think that the other option with an seperate "user project file" is the best way for now.
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
Post Reply