shortcut command lines

Blitz3D Forums/Blitz3D Beginners Area/shortcut command lines

sigheye(Posted 2004) [#1]
how would i use or make my own shortcut commands in my program, like a way of opening up the devs console?
i.e.
just like the "C:/Program Files/Half-Life/hl.exe -console" in the half-life shortcut.

or is it not possible, i thought i saw a b3d game use it before...


WolRon(Posted 2004) [#2]
If you are referring to command line arguments passed to your own program then check out the CommandLine command.


sigheye(Posted 2004) [#3]
ah that was exactly what i needed, thanks


Prym(Posted 2009) [#4]
and referring to command line arguments passed to BlitzBasic program ?


PowerPC603(Posted 2009) [#5]
CommandLine$() returns whatever was sent to the program as command line argument.

So in the case of daeve's example:
"C:/Program Files/Half-Life/hl.exe -console"

CommandLine$() will return "-console".

Or like:
"C:/Program Files/Half-Life/hl.exe -console -programmer -godmode"

CommandLine$() will return "-console -programmer -godmode"

It's your job to parse each part of the argument (console, programmer and godmode), as they are just a string and let your program act accordingly.