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 


Calling Specific line from within VDS EXE

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


Joined: 16 Sep 2002
Posts: 105

PostPosted: Wed Oct 23, 2002 7:23 pm    Post subject: Calling Specific line from within VDS EXE Reply with quote

Is it possible to
Call a Specific line or sub routine
from within VDS EXE.

AS in: VDS.EXE /2 which would call the prog and start at :2 and stop?

Code:

REM  Compile this script and call it VDS
:1
INFO ONE
STOP
:2
Info TWO
STOP


Thanks for all feedback! nt
Back to top
View user's profile Send private message
Skit3000
Admin Team


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

PostPosted: Wed Oct 23, 2002 7:32 pm    Post subject: Reply with quote

That's an easy one!

Code:

rem %1 holds the first parameter which the compiled program got...

goto %1

:1
info This calls 1
exit

:2
warn And this 2
exit

:3
info And guess what... This calls label :3
exit
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Oct 23, 2002 8:00 pm    Post subject: Reply with quote

If the user gives the program a parameter such as "/7" or one that isn't supported, you will get an error. You can solve the problem by using:

Code:
if @null(%1)
warn No Parameter Entered!
goto MainProgramCode
end
if @equal(%1,"/param1")
goto param1
end
if @equal(%1,"/param2")
goto param2
end
if @equal(%1,"/param3")
goto param3
end
:param1
info Enter the code to process here
exit
:param2
info Enter the code to process here
exit
:param3
info Enter the code to process here
exit
:MainProgramCode
rem Main Program Code Here
info Main Program Code Here
exit
rem End Main Program Code

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Oct 23, 2002 8:03 pm    Post subject: Reply with quote

If you want to test your parameter code without having to go to the trouble of compiling, you can use the Run > Command Line feature built into VDS. Enter your parameter, then run your script. Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


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

PostPosted: Wed Oct 23, 2002 8:13 pm    Post subject: Reply with quote

Can be shorter! Wink

Code:
if @equal(%1,1)@equal(%1,2)@equal(%1,3)
  goto @strdel(%1,@pos(/,%1),@pos(/,%1))
  else
  goto mainprogram
  end
 
:1
exit
:2
exit
:3
exit

:Mainprogram
blablabla
Back to top
View user's profile Send private message
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