AcidCorps Posted June 17, 2007 Posted June 17, 2007 select case $cmdline[0] = 0 ; check to see if there is a parameter msgbox(0, "GUI Menu", "") Case $CmdLine[1] = "/?" MsgBox(0, "Switche Index","") Case $Cmdline[0] = 2 $Cmdline[1] = "/Product" $Var = $Cmdline[2] MsgBox(0,"",$Var) EndSelect Exit I Keep getting an error: Line 7: $Cmdline[1] = "/Product" ^Error Error: Cannot assign values to constants.
Developers Jos Posted June 17, 2007 Developers Posted June 17, 2007 select case $cmdline[0] = 0 ; check to see if there is a parameter msgbox(0, "GUI Menu", "") Case $CmdLine[1] = "/?" MsgBox(0, "Switche Index","") Case $Cmdline[0] = 2 $Cmdline[1] = "/Product" $Var = $Cmdline[2] MsgBox(0,"",$Var) EndSelect Exit I Keep getting an error: Line 7: $Cmdline[1] = "/Product" ^Error Error: Cannot assign values to constants. You cannot assign your value to the commandline variable.. What is it you want to accomplish ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Emperor Posted June 17, 2007 Posted June 17, 2007 Something like this? ; ... Case $CmdLine[0] = 2 And $CmdLine[1] = "/Product" ; ...
AcidCorps Posted June 17, 2007 Author Posted June 17, 2007 well in another post I asked how to use the commandline to create a $var and I got this as a response $Var = $CmdLine[2] it worked for another script but I can't get it to work for this one.
randallc Posted June 17, 2007 Posted June 17, 2007 Hi, Just delete the silly line...? select case $cmdline[0] = 0 ; check to see if there is a parameter msgbox(0, "GUI Menu", "") Case $CmdLine[1] = "/?" MsgBox(0, "Switche Index","") Case $Cmdline[0] = 2 if $Cmdline[1] = "/Product" then $Var = $Cmdline[2] MsgBox(0,"",$Var) EndSelect Exit ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
FreeFry Posted June 17, 2007 Posted June 17, 2007 Problem is that you're trying to SET the value of the $CommandLine constant. That you cannot do...
AcidCorps Posted June 18, 2007 Author Posted June 18, 2007 Ok this worked perfect but now I realized I'm going to be needing it to recognize 3 switches and having the third be the variable setup.au3 /Product Group1 $var I've read the cmdline reference a million times but I can't get the hang of it. how do I get two command line parameters and a third being a $var like the above post.
PsaltyDS Posted June 18, 2007 Posted June 18, 2007 (edited) Ok this worked perfect but now I realized I'm going to be needing it to recognize 3 switches and having the third be the variable setup.au3 /Product Group1 $var I've read the cmdline reference a million times but I can't get the hang of it. how do I get two command line parameters and a third being a $var like the above post. Maybe I see your confusion. You don't use the $CmdLine array to pass parameters OUT, only for seeing them coming IN. Any old variable can be used to pass parameters out to another script (or another instance of the same script): $var = '"My Third Parameter"' Run("AutoIt3.exe setup.au3 /Product Group1" & $var) Edited June 18, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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