Page 1 of 1
Variables in Configure tools
Posted: Tue Feb 17, 2009 10:16 am
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
Re: Variables in Configure tools
Posted: Tue Feb 17, 2009 10:35 am
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
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
Re: Variables in Configure tools
Posted: Tue Feb 17, 2009 11:09 am
by Michael Vogel
Little John wrote:By default, the file is in the
[...]
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
Re: Variables in Configure tools
Posted: Tue Feb 17, 2009 8:16 pm
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
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
Re: Variables in Configure tools
Posted: Tue Feb 17, 2009 8:35 pm
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
Posted: Tue Feb 17, 2009 9:01 pm
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.
Posted: Wed Feb 18, 2009 11:19 am
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