Xenos 0 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 Share this post Link to post Share on other sites
Domonoky 0 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 Share this post Link to post Share on other sites
Xenos 0 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! Share this post Link to post Share on other sites