Jump to content

Recommended Posts

Posted

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

Posted

Switch $CmdLine[1]
Case "A1"
_ArrayDisplay($A1)

Case "B1"
 _ArrayDisplay($B1)

Case "C1"
 _ArrayDisplay($C1)
EndSwitch

Posted

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[]

Posted

#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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...