Xenos Posted January 25, 2005 Share Posted January 25, 2005 Hello again! I was wondering if I can pass arguments to my script via a switch on the exe I compile? ie: CODE $ANSWER=1 If x not null then $ANSWER = x end if SCRIPT.EXE -5 Can I pass the switch (-5) to the script (to equal x in this case)? Thanks! Newbie Link to comment Share on other sites More sharing options...
Domonoky Posted January 25, 2005 Share Posted January 25, 2005 Hi.. Passing an argument to the script is not the problem. If you look in the helpfile for: $CmdLine .. its an array with all arguments in it.. you use it like: if $CmdLine[0]= 0 Then ;if there is no argument FileWriteLine($file,"Error: no .ini file found");write error Exit(1) ;and exit else ;else $inifile=$CmdLine[1] ;save first argument in variable EndIf Link to comment Share on other sites More sharing options...
Xenos Posted January 25, 2005 Author Share Posted January 25, 2005 Hi..Passing an argument to the script is not the problem.If you look in the helpfile for: $CmdLine .. its an array with all arguments in it.. you use it like:if $CmdLine[0]= 0 Then ;if there is no argument FileWriteLine($file,"Error: no .ini file found");write error Exit(1) ;and exit else ;else $inifile=$CmdLine[1] ;save first argument in variable EndIf<{POST_SNAPBACK}>Thank you very much. if $CmdLine[0] = 0 then $ANSWER = 1 else $ANSWER = $CmdLine[1] end ifVery good! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now