Variables in Configure tools

Working on new editor enhancements?
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Variables in Configure tools

Post by Michael Vogel »

Is it possible to get the information of the location of the Purebasic configuration file within a program which is used for a IDE tool?

I have programmed a nice extension which works fine, but I'd like to use it on my USB stick as well, where I have the full purebasic environment to be able to program everywhere.

So the drive letter can be different and I can't get the information of some settings - for instance the tabulator setting from the Purebasic config file.

Michael
Little John
Addict
Addict
Posts: 4789
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Variables in Configure tools

Post by Little John »

Michael Vogel wrote:Is it possible to get the information of the location of the Purebasic configuration file within a program which is used for a IDE tool?

I have programmed a nice extension which works fine, but I'd like to use it on my USB stick as well, where I have the full purebasic environment to be able to program everywhere.

So the drive letter can be different and I can't get the information of some settings - for instance the tabulator setting from the Purebasic config file.

Michael
By default, the file is in the

Code: Select all

%APPDATA%\PureBasic\
directory on the system. (%APPDATA% automatically provides the proper drive letter.)
The configuration file might be located somewhere else, depending on the command-line switches that you used when launching PB. For more details, see in the Help
IDE Commandline options
Regards, Little John
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Variables in Configure tools

Post by Michael Vogel »

Little John wrote:By default, the file is in the

Code: Select all

%APPDATA%\PureBasic\
[...]
IDE Commandline options
Regards, Little John
Thanks, Little John - I was searching within the help file for words, like Configure, Tools, but didn't find anything.

I'll try that now, hopefully it will work :roll:

Michael
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Variables in Configure tools

Post by Michael Vogel »

Michael Vogel wrote: I'll try that now, hopefully it will work :roll:
I did not see, that this can't work :cry:

The Environment variable %APPDATA does not show the path to the configure file (at least, when PB is started in portable mode)!

I use the portable mode, because I use my PB stuff also at work and don't want that anything is written to the registry (BTW I don't like the PB icons which get changed when the IDE is started without the /PORTABLE parameter)

So it's tricky to solve that - the only way I see is that the tool have to be given into a certain directory...

Michael
Little John
Addict
Addict
Posts: 4789
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Variables in Configure tools

Post by Little John »

Michael Vogel wrote:The Environment variable %APPDATA does not show the path to the configure file (at least, when PB is started in portable mode)!
Yes, that's the reason why I wrote:
The configuration file might be located somewhere else, depending on the command-line switches that you used when launching PB. For more details, see in the Help
IDE Commandline options
Here it is in German: IDE Kommandozeilen-Optionen.

Regards, Little John
freak
PureBasic Team
PureBasic Team
Posts: 5941
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

In portable mode, the preferences are always in the directory of the IDE, so for this case you can use the PB_TOOL_IDE variable like this:

Code: Select all

PreferenceFile$ = GetPathPart(GetEnvironmentVariable("PB_TOOL_IDE")) + "PureBasic.prefs"

I added PB_TOOL_Preferences as an environment variable for the tools for the next version.
quidquid Latine dictum sit altum videtur
User avatar
Michael Vogel
Addict
Addict
Posts: 2807
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

freak wrote:In portable mode [...]you can use the PB_TOOL_IDE variable [...]
Thanks!
freak wrote:I added PB_TOOL_Preferences as an environment variable for the tools for the next version.
THANKS!

Michael
Post Reply