| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Mar 20, 2002 4:33 pm Post subject: Command Line Parameters? |
|
|
Could someone post a simple example on how to command line parameters eg.
myprog.exe /w/test stuff//o ????????
Rubes_sw |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Mar 20, 2002 5:33 pm Post subject: |
|
|
When you pass parameters to your program on the command line, they
are assigned to the variable names %1, %2 etc. in the order they occur.
(The variable %0 always holds the full pathname of your program.)
For instance:
YOURPROG.EXE onevalue anothervalue
In your program you can then use the values passed on the command
line:
variable %1 holds onevalue
variable %2 holds anothervalue
You must observe that space characters delimit parameters so don't
use parameters with spaces chars.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Wed Mar 20, 2002 7:25 pm Post subject: |
|
|
Hello,
Just to add on to what the Dr. said, You can only have up to
9 command line params. %1 - %9
Here is a small script to combine the variables if you are
passing a filename/path with spaces
| Code: |
%%filename =
repeat
%%filename = %%filename%1" "
shift
until @not(%1)
%%filename = @trim(%%filename)
|
_________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
|