| View previous topic :: View next topic |
| Author |
Message |
harrys Newbie

Joined: 25 Feb 2007 Posts: 22
|
Posted: Thu Mar 22, 2007 5:49 pm Post subject: command line switchs |
|
|
hi guys,
i find that i need to turn one thing on & off in a compiled exe
no way you can use a check box or what have you.
i've used switches since win3.1 & dos but i've never
programed one in ..
vds4 manual says 1-9 can be used but how?
would someone take pitty on this slacker and post a bit of code
showing me how its done?
thanks
georges
btw: thanks pgware for the response to my email question. |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Mar 22, 2007 6:48 pm Post subject: |
|
|
When you run your compiled program like this:
| Code: | | yourprog.exe firstpar secondpar |
The %1 variable will contain "firstpar", the %2 will contain "secondpar". Using the shift command, you can shift the value of all parameters one position to the left, so the value of %1 will become %2, etc. In the above example, %1 would become "secondpar" while %2 will be empty.
You can use command line switches with the VDS IDE itself, by clicking the Run menu and by choosing "Command Line".  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Last edited by Skit3000 on Thu Mar 22, 2007 6:48 pm; edited 1 time in total |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Mar 22, 2007 6:48 pm Post subject: |
|
|
You can compile that and run it with 3 switches.
C:\example.exe /on /s /test _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
harrys Newbie

Joined: 25 Feb 2007 Posts: 22
|
Posted: Thu Mar 22, 2007 7:25 pm Post subject: |
|
|
SS,
tried your example but get error code "can't find file"
skit3000 ,
i understand the shift command but the real working
of the code for the program itsself i'm still vauge on.
so you have
progy.exe on
is that 'on' contained in the variable %1 ?
so in the code you :
if @equal(%1,on)
do that
else if @not(@equal (%1,on))
don't do that
end
thanks for the inlightenment |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Thu Mar 22, 2007 8:04 pm Post subject: |
|
|
It was just an example, you could compile the code I gave you as 'c:\example.exe' and then run that exe with those command line switches.
Yes if you used my example, %1 would hold '/on'. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
|