Page 1 of 1

Run source with command parameter

Posted: Mon Feb 02, 2026 7:43 pm
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

Re: Run source with command parameter

Posted: Mon Feb 02, 2026 8:07 pm
by Sergey
Yes, you just need add tool and select "Before Compile/Run"
And a tool will do anything what you want

Re: Run source with command parameter

Posted: Mon Feb 02, 2026 8:56 pm
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

Re: Run source with command parameter

Posted: Mon Feb 02, 2026 9:13 pm
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)

Re: Run source with command parameter

Posted: Mon Feb 02, 2026 11:24 pm
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)