Page 1 of 1
Command-line project
Posted: Sun Jun 24, 2018 7:04 am
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 ?
Re: Command-line project
Posted: Sun Jun 24, 2018 8:17 am
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)

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))

Re: Command-line project
Posted: Sun Jun 24, 2018 8:41 am
by Denis
Ok Marc56us
i will try
"(but I don't use a project-specific pref file)"
I use it to load the correct project and only this one.
Re: Command-line project
Posted: Sun Jun 24, 2018 9:01 am
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"

Re: Command-line project
Posted: Sun Jun 24, 2018 3:59 pm
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...
Truce of joke

, I'm always curious about everything and I like to have a headache...
Thank you