Page 1 of 1

IDE External Tools and variables PB_TOOL_XXXXX [resolved]

Posted: Fri Aug 15, 2025 4:28 pm
by thyphoon
Hello,
in the documentation it is noted regarding external tools:
The IDE provides additional information for tools in the form of environment variables. They can be easily read by the tool using Process library commands.

Here is a list of variables provided. Note that those that provide information about the file being edited are not accessible for tools running when starting or closing the IDE.
PB_TOOL_IDE - Chemin complet et nom de l'exécutable de l'IDE
PB_TOOL_Compiler - Chemin complet et nom de l'exécutable du compilateur
PB_TOOL_Preferences - Chemin complet et nom du fichier des préférences de l'IDE
PB_TOOL_Project - Chemin complet et le nom du projet actuellement ouvert (le cas échéant)
PB_TOOL_Language - Langue actuellement utilisée dans l'IDE
PB_TOOL_FileList - Liste de tous les fichiers ouverts dans l'IDE, séparés par un Chr(10)

PB_TOOL_Debugger - Ces variables fournissent les paramètres correspondant à ceux de la fenêtre d'options de compilation
PB_TOOL_InlineASM pour le source en cours. Elles sont à 1 si l'option
PB_TOOL_Unicode est activée, à 0 sinon.
PB_TOOL_Thread
PB_TOOL_XPSkin
PB_TOOL_OnError

PB_TOOL_SubSystem - Contenu du champ Bibliothèque Sous-système dans les options de compilation
PB_TOOL_Executable - Identique au mot-clef %COMPILEFILE pour la ligne de commande
PB_TOOL_Cursor - Identique au mot-clef %CURSOR pour la ligne de commande
PB_TOOL_Selection - Identique au mot-clef %SELECTION pour la ligne de commande
PB_TOOL_Word - Identique au mot-clef %WORD pour la ligne de commande

PB_TOOL_MainWindow - Identifiant système (Handle) de la fenêtre principale de l'IDE
PB_TOOL_Scintilla - Identifiant système (Handle) du composant d'édition de code Scintilla pour le source en cours
but I don't get any back by doing it

Code: Select all


If ExamineEnvironmentVariables()
    While NextEnvironmentVariable()
        Debug (EnvironmentVariableName() + " = " + EnvironmentVariableValue())
    Wend
EndIf

under Windows PB 6.21(x64)

anyone have an idea? is this no longer relevant? is there another way to do it?

thanks in advance

Re: IDE External Tools and variables PB_TOOL_XXXXX

Posted: Fri Aug 15, 2025 4:36 pm
by Axolotl
You compiled and configured it as a IDE-Tool, right?
Of cause!

Re: IDE External Tools and variables PB_TOOL_XXXXX

Posted: Fri Aug 15, 2025 4:47 pm
by Axolotl
BTW:
you can create a bat file with something like this
You will see, this is only working as a IDE Tool .... see also in the IDE -> Tools | Configure Tools....

Code: Select all

echo PB_TOOL 
echo IDE         = %PB_TOOL_IDE% 
echo Compiler    = %PB_TOOL_Compiler% 
echo Preferences = %PB_TOOL_Preferences% 
echo Project     = %PB_TOOL_Project%  
echo Language    = %PB_TOOL_Language% 
echo FileList    = %PB_TOOL_FileList%  

Re: IDE External Tools and variables PB_TOOL_XXXXX

Posted: Fri Aug 15, 2025 5:32 pm
by thyphoon
Variables do not exist.

C:\Users\413\Desktop\Films>echo PB_TOOL
PB_TOOL

C:\Users\413\Desktop\Films>echo IDE =
IDE =

C:\Users\413\Desktop\Films>echo Compiler =
Compiler =

C:\Users\413\Desktop\Films>echo Preferences =
Preferences =

C:\Users\413\Desktop\Films>echo Project =
Project =

C:\Users\413\Desktop\Films>echo Language =
Language =

C:\Users\413\Desktop\Films>echo FileList =
FileList =

C:\Users\413\Desktop\Films>Pause
Appuyez sur une touche pour continuer...

Re: IDE External Tools and variables PB_TOOL_XXXXX

Posted: Fri Aug 15, 2025 5:53 pm
by AZJIO
You must run it as a tool, then the program becomes a child process and inherits the variables. If you run the file on its own, it will only see the Windows variables and its own variables, if it has any.

Code: Select all

If OpenConsole()
	If ExamineEnvironmentVariables()
		While NextEnvironmentVariable()
			Print(EnvironmentVariableName() + " = " + EnvironmentVariableValue())
			Print(#CRLF$)
		Wend
	EndIf
	PrintN("Press Return to exit")
	Input()
EndIf

Code: Select all

Text$ = ""
If ExamineEnvironmentVariables()
    While NextEnvironmentVariable()
    	Text$ + EnvironmentVariableName() + " = " + EnvironmentVariableValue() + #CRLF$
    Wend
EndIf
SetClipboardText(Text$)
MessageRequester("", Text$)

Re: IDE External Tools and variables PB_TOOL_XXXXX

Posted: Fri Aug 15, 2025 8:28 pm
by thyphoon
ha ok super ça marche j'avais pas compris cette subtilité.un grand merci

ha ok great it works I didn't understand this subtlety. Many thanks🥳🎉