forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Command Line Parameters?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Wed Mar 20, 2002 4:33 pm    Post subject: Command Line Parameters? Reply with quote

Could someone post a simple example on how to command line parameters eg.

myprog.exe /w/test stuff//o ????????


Rubes_sw
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Mar 20, 2002 5:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Wed Mar 20, 2002 7:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group