Command-line project

Everything else that doesn't fall into one of the other PB categories.
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Command-line project

Post by Denis »

I use a little tool to open different projects in the ide (32 or 64 and with different PB version).
To do that, i use a specific PureBasic.prefs for each case, i've changed "DefaultProject = " inside for each PureBasic.prefs with the correct one.

For example

Code: Select all

RunProgram("Purebasic.exe",
"/P C:\Users\user\AppData\Roaming\PureBasic\PIM\PIM_PureBasic.prefs /A C:\Users\user\AppData\Roaming\PureBasic\PIM\PIM_Tools.prefs",
"G:\PureBasic\PureBasic_5_70_x86")
and Pref file

Code: Select all

[Projects]
; 
DefaultProject = G:\PureBasic\PureIconManager.pbp

Is there a way to load/close a project in command-line without changing each PureBasic.prefs when the ide opens ?
A+
Denis
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Command-line project

Post by Marc56us »

Just specify the name of the project in the parameters

Code: Select all

IDE$     = "C:\Program Files\PureBasicBeta\PureBasic.exe"
Project$ = "G:\PureBasic\PureIconManager.pbp"
Params$  = "/P C:\Users\user\AppData\Roaming\PureBasic\PIM\PIM_PureBasic.prefs /A C:\Users\user\AppData\Roaming\PureBasic\PIM\PIM_Tools.prefs",
"G:\PureBasic\PureBasic_5_70_x86"

RunProgram(IDE$, Project$ + " " + Params$, "")
DefaultProject is just an option that indicates which project to load by default, if you want one

On my side, I simply use a folder on desktop (or my launcher) in which I put shortcuts on the different files .pbp (but I don't use a project-specific pref file)

:idea: Since PB 5.60, User data can be reach easily using GetUserDirectory(#PB_Directory_ProgramData)
To see what matches #PB_Directory_ProgramData

Code: Select all

Debug GetUserDirectory(#PB_Directory_ProgramData)
It is better to use this because the program variables will follow, even when changing machine or connection type (local (local machine) or network (roaming))

:wink:
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Command-line project

Post by Denis »

Ok Marc56us

i will try

:wink:

"(but I don't use a project-specific pref file)"

I use it to load the correct project and only this one.
A+
Denis
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Command-line project

Post by Marc56us »

Denis wrote: I use it to load the correct project and only this one.
PB IDE only loads one project at a time anyway.
To avoid having other independent files loaded at the same time, just set:

Project Option > Project Option > Loading Option > (*) load only sources marked in "Project files"

:wink:
Denis
Enthusiast
Enthusiast
Posts: 704
Joined: Fri Apr 25, 2003 5:10 pm
Location: Doubs - France

Re: Command-line project

Post by Denis »

Marc56us wrote:
Denis wrote: "G:\PureBasic\PureIconManager.pbp"
So obvious ... I'm really tired
Maybe I'm too old to continue coding ...
Sometimes obvious things escape me... :oops:

Truce of joke :mrgreen: , I'm always curious about everything and I like to have a headache...

Thank you
A+
Denis
Post Reply