Jump to content
Sign in to follow this  
JoGa

Assign by name for array

Recommended Posts

JoGa

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Paulie

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?

Share this post


Link to post
Share on other sites
James

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

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

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
pdaughe

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

Share this post


Link to post
Share on other sites
JoGa

Tnx pdaughe, your hint answers my question: no Assign/Eval with arrays :/

Share this post


Link to post
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
Sign in to follow this  

×