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 switchs

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


Joined: 25 Feb 2007
Posts: 22

PostPosted: Thu Mar 22, 2007 5:49 pm    Post subject: command line switchs Reply with quote

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 .. Embarassed
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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Mar 22, 2007 6:48 pm    Post subject: Reply with quote

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". Smile

_________________
[ 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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Mar 22, 2007 6:48 pm    Post subject: Reply with quote

Code:

info %1 %2 %3
exit

You can compile that and run it with 3 switches.
C:\example.exe /on /s /test

_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
harrys
Newbie


Joined: 25 Feb 2007
Posts: 22

PostPosted: Thu Mar 22, 2007 7:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Thu Mar 22, 2007 8:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
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