Switch between file.pbi and file.pb?

Working on new editor enhancements?
Justin
Addict
Addict
Posts: 832
Joined: Sat Apr 26, 2003 2:49 pm

Switch between file.pbi and file.pb?

Post by Justin »

I'm looking for a way to quickly switch from a file and its include or viceversa, can an external tool do it?
I don't see any option to select a file for an external tool.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Switch between file.pbi and file.pb?

Post by davido »

Hi Justin,

If you just double-click on the Keyword Include then the file will be loaded into the IDE.

I am sure that this is not exactly what you want, but I hope it might help.
DE AA EB
User avatar
skywalk
Addict
Addict
Posts: 3997
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Switch between file.pbi and file.pb?

Post by skywalk »

Not until this is released...
A workaround freak mentioned is to make a Tool that opens your file provided you check "Run only one instance of the IDE".

Code: Select all

exe$ = GetEnvironmentVariable("PB_TOOL_IDE")
RunProgram(exe$, "c:\myproject\myinclude.pbi /L 1", "c:\myproject")
The problem is jumping back and forth and feeding the name of your files.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Danilo
Addict
Addict
Posts: 3037
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Switch between file.pbi and file.pb?

Post by Danilo »

skywalk wrote:The problem is jumping back and forth and feeding the name of your files.
If the filename is the same, just switch between extension .pb and .pbi:

Code: Select all

IDE.s  = GetEnvironmentVariable("PB_TOOL_IDE")
FILE.s = ProgramParameter(0)

If FILE And IDE
    If LCase(GetExtensionPart(FILE)) = "pbi"
        FILE = Left(FILE, Len(FILE)-1)
    ElseIf LCase(GetExtensionPart(FILE)) = "pb"
        FILE + "i"
    EndIf
    
    ;MessageRequester("INFO",FILE)
    If FileSize(FILE) >= 0
        RunProgram(IDE, #DQUOTE$+FILE+#DQUOTE$, #DQUOTE$+GetPathPart(FILE)+#DQUOTE$)
    EndIf
EndIf
Requires argument "%FILE" (with double quotes) in the tool settings.
Justin
Addict
Addict
Posts: 832
Joined: Sat Apr 26, 2003 2:49 pm

Re: Switch between file.pbi and file.pb?

Post by Justin »

Thanks Danilo, that works fine.
skywalk, that post is from 2011 i guess it has stopped?
davido, i knew that thanks anyways.
Post Reply