PB_Tool_File

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

PB_Tool_File

Post by PB »

In the manual in the "External tools" section, it lists some environment variables that you can access for your source. Unfortunately, there is no "PB_Tool_File" variable to show the full path and name of the current loaded source. Could this be added, please?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PB_Tool_File

Post by ts-soft »

What is with %PATH and %FILE?
or have i misunderstand you?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB_Tool_File

Post by PB »

They're not environment variables; they are commandline arguments, which I don't want.

From the manual:

Code: Select all

PB_TOOL_Cursor     - same as the %CURSOR token for the commandline
PB_TOOL_Selection  - same as the %SELECTION token for the commandline
PB_TOOL_Word       - same as the %WORD token for the commandline
And this was added for the v4.40 beta:

Code: Select all

PB_TOOL_Preferences
So I'd like to see this also added to the above group:

Code: Select all

PB_TOOL_File       - same as the %FILE token for the commandline
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: PB_Tool_File

Post by freak »

Adding %FILE to the commandline parameters causes the file to be saved to disk so it is up to date with the editor contents. Environment variables only exist for information that does not need such additional action and can therefore always be provided.
quidquid Latine dictum sit altum videtur
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB_Tool_File

Post by PB »

@Freak: So, are you saying that it will be added? I need my tool to know which source is being edited, without saving the source. Currently I'm doing it by reading the title bar of the IDE, which is set to show the full path of the current source, but not everyone will have that setting enabled, so I need a different bullet-proof way to know it.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: PB_Tool_File

Post by freak »

> So, are you saying that it will be added?

Probably not.
quidquid Latine dictum sit altum videtur
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PB_Tool_File

Post by PB »

:( How else can I achieve my goal then?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply