Nialaghr 0 Report post Posted May 23, 2008 Hi, I have three arrays and I need to display the array corresponding to the name passed from cmdline.(A1,B1 or C1) ex: #include <array.au3> $A1=_ArrayCreate("A1","A2","A3") $B1=_ArrayCreate("B1","B2","B3") $C1=_ArrayCreate("C1","C2","C3") $Name="$"& $CmdLine[1] MsgBox(0," Name",$Name) $d1 =_ArrayDisplay($Name) It looks like the variable $Name is not recognized as an Array. Thanks Share this post Link to post Share on other sites
weaponx 10 Report post Posted May 23, 2008 Switch $CmdLine[1] Case "A1" _ArrayDisplay($A1) Case "B1" _ArrayDisplay($B1) Case "C1" _ArrayDisplay($C1) EndSwitch Share this post Link to post Share on other sites
Nialaghr 0 Report post Posted May 23, 2008 Thanks for you answer eaponx, but since the real program is much more complex it makes is difficult to use this solution. I am really looking for a way to use the parameter passed by CmdLine[] Share this post Link to post Share on other sites
weaponx 10 Report post Posted May 23, 2008 #include <array.au3> $cmd = "A1" $A1=_ArrayCreate("A1","A2","A3") $B1=_ArrayCreate("B1","B2","B3") $C1=_ArrayCreate("C1","C2","C3") $temp = Eval($cmd) _ArrayDisplay($temp) Share this post Link to post Share on other sites
Nialaghr 0 Report post Posted May 23, 2008 Thanks Weaponx, exactly what I was looking for. Just learned a new command: Eval(). works great! Share this post Link to post Share on other sites