Jump to content

Assign by name for array


Recommended Posts

Hi,

based on a space separated list with an unknown number of array names, I want to create a bunch of arrays.

like this:

Global $ArrayList="array1 array2 array3 ..."

to be transformed into

$Global $array1[2]

$Global $array2[2]

$Global $array3[2]

$Global $...

I know the function 'Assign' which is used to create variables by name.

Is there a methode to create arrays by name?

Thanks for hints

Jo

Link to comment
Share on other sites

Hi,

based on a space separated list with an unknown number of array names, I want to create a bunch of arrays.

like this:

Global $ArrayList="array1 array2 array3 ..."

to be transformed into

$Global $array1[2]

$Global $array2[2]

$Global $array3[2]

$Global $...

I know the function 'Assign' which is used to create variables by name.

Is there a methode to create arrays by name?

Thanks for hints

Jo

I don't think so, but even if you could, why would you want to...?

:P

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
Link to comment
Share on other sites

I was just thinking that. If you have an array then you are saving space :P

Saving space over what? I wasn't asking why would you want arrays, only why would want string variable names for arrays (Assign/Eval with arrays)?

:P

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
Link to comment
Share on other sites

Saving space over what? I wasn't asking why would you want arrays, only why would want string variable names for arrays (Assign/Eval with arrays)?

:P

Logic would dictate you create another dimension. no?
Link to comment
Share on other sites

Well why create a new set of arrays of exisiting values?

I have no idea, we'll have to wait for the OP to explain the desired functionality here.

:P

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
Link to comment
Share on other sites

Hi,

based on a space separated list with an unknown number of array names, I want to create a bunch of arrays.

like this:

Global $ArrayList="array1 array2 array3 ..."

to be transformed into

$Global $array1[2]

$Global $array2[2]

$Global $array3[2]

$Global $...

I know the function 'Assign' which is used to create variables by name.

Is there a methode to create arrays by name?

Thanks for hints

Jo

I appreciate that there are some algorithms where such functionality is advantageous. You asked for hints: 1) I posted on this topic before....2) a one-dimensional array is also referred to as a "List". Think about how you can create a "list" in AutoIT and keep track of it.... Edited by pdaughe
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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