Run source with command parameter

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5668
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Run source with command parameter

Post by Kwai chang caine »

Hello at all

Is it possible to compile a source (Click on button or F5) with IDE and sending command parameter
/P <Preferences file> loads/saves all the configuration to/from the given file
/T <Templates file> loads/saves the code templates from/to the given file
/A <tools file> loads/saves the configuration of the external tool from/to this file
/S <Source path> overwrites the "Source path" setting from the preferences
/E <Explorer path> starts the Explorer tool with the given path
/L <Line number> moves the cursor to the given line number in the last opened file
/H <HistoryDatabase> specify the file to use for the session history database
/NOEXT disables the registering of the .pb extension in the registry
/LOCAL puts all preferences in the PureBasic directory instead of the user profile location
/PORTABLE the same as /LOCAL and /NOEXT combined
Have a good day
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Sergey
User
User
Posts: 91
Joined: Wed Jan 12, 2022 2:41 pm

Re: Run source with command parameter

Post by Sergey »

Yes, you just need add tool and select "Before Compile/Run"
And a tool will do anything what you want
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5668
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Run source with command parameter

Post by Kwai chang caine »

Hello Sergey

Ok but in the "Command Line" of the tool, i write what?

Code: Select all

C:\PB\v6.21\Compilers\pbcompiler C:\PB\MyCodeSource.pb /DEBUGGER /S C:\PB\Pref\ /P C:\PB\Pref\PureBasic.prefs /T C:\PB\Pref\Templates.prefs /H C:\PB\Pref\History.db /A C:\PB\Pref\Tools.prefs
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
#NULL
Addict
Addict
Posts: 1504
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Run source with command parameter

Post by #NULL »

Do you want your own sourcefile/programm receive command line arguments when compiled/run from within the IDE?
docs > The PureBasic IDE > Compiling your programs
Executable command-line
The string given here will be passed as the command-line to the program when running it from the IDE. The content of this string can be got with ProgramParameter().
https://www.purebasic.com/documentation ... piler.html
(see screenshot in the doc for compiler options)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5668
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Run source with command parameter

Post by Kwai chang caine »

Yes.. I believe i have understand what you have say to me
There are a command line option in run tab
I never use this option and completly forgotten it :oops:
Thanks a lot for your help
I try tommorow i'm on my phone now :wink:
Have a very good night 8)
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
Post Reply