Page 1 of 1

%COMPILERPATH, GetCompilerDirectory() [Resolved]

Posted: Mon Jan 26, 2015 10:21 am
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

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Posted: Mon Jan 26, 2015 11:37 am
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

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Posted: Mon Jan 26, 2015 12:39 pm
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)

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Posted: Mon Jan 26, 2015 2:40 pm
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)

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Posted: Mon Jan 26, 2015 3:13 pm
by helpy
PUREBASIC_HOME ist not documented! There is no hint in the PureBasic help.

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Posted: Mon Jan 26, 2015 3:19 pm
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)

Re: %COMPILERPATH, %COMPILERVERSION, GetCompilerDirectory()

Posted: Mon Jan 26, 2015 4:23 pm
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

Re: %COMPILERPATH, GetCompilerDirectory() [Resolved]

Posted: Mon Jan 26, 2015 4:44 pm
by Kwai chang caine
Yes you have right
And several other PB_TOOLS furthermore
Perhaps someone have the answer at this question ???

Re: %COMPILERPATH, GetCompilerDirectory() [Resolved]

Posted: Mon Jan 26, 2015 4:47 pm
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.

Re: %COMPILERPATH, GetCompilerDirectory() [Resolved]

Posted: Tue Jan 27, 2015 9:31 am
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: