%COMPILERPATH, GetCompilerDirectory() [Resolved]

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

%COMPILERPATH, GetCompilerDirectory() [Resolved]

Post by Kwai chang caine »

Hello

Yesterday, i try to create several tools in the IDE and impossible to have the path of the IDE :shock:
I have read several post like this one
http://www.purebasic.fr/english/viewtop ... 88#p447388
But nothing really good :(

The solution is create an exe, for example "Path.exe" With GetModuleFileName_(0, @Application, 255) and call it by the tools menu, but i'm forced each time to put it in each folder of each version...
For only one line of code :shock:

I think that can be useful to know what IDE/Compiler call an exe, furthermore the version, and like it's impossible to have this information...
We have all this information now, but only in CONSTANTS...
#PB_Compiler_Version
#PB_Compiler_Home

and if you move your exe on a USB key..."waloo !!!" (French expression) :mrgreen:

Finally, i use the runprogram() association, but if any PB have installed in the PC...."RE WALLOO !!!" :| (Always french expression but too time :wink: :lol:)

Have a good day
Last edited by Kwai chang caine on Mon Jan 26, 2015 3:20 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Post by helpy »

Hi Kwai chang caine,

Am I right? You want to get the path to the IDE, which is calling the tools program.

Try the environment variable: GetEnvironmentVariable("PB_TOOL_IDE")
See documentation for external IDE tools: http://www.purebasic.com/documentation/ ... tools.html

cu,
guido
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Post by Kwai chang caine »

Hello Helpy :D
I take a look at your tips, and say my mean to you, if It's exactely what i want :shock:
Thanks for your answer 8)
ImageThe happiness is a road...
Not a destination
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Post by Kwai chang caine »

Yeeees !!!!!!
You have right, thanks, thanks, thanks, thanks, thanks :D
In fact like usually, KCC have a train to late :oops:
But somewhere, that mean, KCC not always say ONLY bullshit, because FRED have already added the %HOME parameter :mrgreen:
I have not see it, because i use the 5.23, and the %HOME appears only at the v5.30...

For the second request, you have always right, thanks, thanks, thanks, thanks, thanks :D
Just a little thing, i have make several try and see the parameter is "PUREBASIC_HOME" and not "PB_TOOL_IDE"
And here i have no apology, because even under v4.51 that works :shock: :oops:

Well.....KCC have again open is big mouth for nothing :oops:
Perhaps the gods hide this thread at FRED...else...i give the permission at FRED :mrgreen: to move it or in the garbage...or in beginer

In all case, thanks to you, i have resolving my problem
Again thanks HELPY, and have a very good day 8)
ImageThe happiness is a road...
Not a destination
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Post by helpy »

PUREBASIC_HOME ist not documented! There is no hint in the PureBasic help.
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Post by Kwai chang caine »

And the "PB_TOOL_IDE" return nothing :shock:
Perhaps FRED have changed something and fiorget to put it on the doc

In fact...i have found it, thanks to an enumeration

Code: Select all

 OpenConsole()
  If ExamineEnvironmentVariables()
    While NextEnvironmentVariable()
      PrintN(EnvironmentVariableName() + " = " + EnvironmentVariableValue())
    Wend
  EndIf
  PrintN("")
  PrintN("Appuyez sur [Entree] pour quitter.")
  Input()
But without you, never i think to the EnvironmentVariable for have the dynamical path of the IDE 8)
ImageThe happiness is a road...
Not a destination
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Post by helpy »

Kwai chang caine wrote:And the "PB_TOOL_IDE" return nothing :shock:
PB_TOOL_IDE is documented!
See documentation for external IDE tools: http://www.purebasic.com/documentation/ ... tools.html
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: %COMPILERPATH, GetCompilerDirectory() [Resolved]

Post by Kwai chang caine »

Yes you have right
And several other PB_TOOLS furthermore
Perhaps someone have the answer at this question ???
ImageThe happiness is a road...
Not a destination
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: %COMPILERPATH, GetCompilerDirectory() [Resolved]

Post by Little John »

PUREBASIC_HOME is documented e.g. here. :D

Seriously:
PUREBASIC_HOME can be optionally set by the user. It is mentioned e.g. in the Linux "Install" file.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: %COMPILERPATH, GetCompilerDirectory() [Resolved]

Post by Kwai chang caine »

In fact in my case no.
I need the path for have what ide runnning a tool

I have a big purebasic folder
Inside, ALL the version of pb (2.0 at 5.31) when you love, nothing is too much :mrgreen:
Beside all pb folder, a folder of tools, a folder of preference, exemples, etc...
I must can be acces of préférences, tools, etc by each version

Like this, i run a v4.51 i have exactely the same toolbar, same configuration etc... that in v5.31
Thats works fine, exept sometime i run a tool and it must return result in the version parent
And if i don't know what version have running the tool i can't do this return

I can't send the version at the tool, with the tools manager, because the file config of toolbar is common at all the versions..
Without PURE_HOME i'm in the pooh !! :mrgreen:
ImageThe happiness is a road...
Not a destination
Post Reply