Jump to content

Recommended Posts

Posted

Is it possible to create arrays where the array number is a variable? For example, $var[$count] = 1. But that says badly formatted array.

  • Moderators
Posted

Is it possible to create arrays where the array number is a variable? For example, $var[$count] = 1. But that says badly formatted array.

You have to create the array first, and the number must be there...

#include <array.au3>
Dim $var[3]
$count = 2
$var[$count] = 1
_ArrayDisplay($var)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Is it possible to do it without creating the array first? I need this to create an infinite number of arrays if needed. So i cound just have $count increase rather than have to define arrays if they are not needed.

  • Moderators
Posted

Is it possible to do it without creating the array first? I need this to create an infinite number of arrays if needed. So i cound just have $count increase rather than have to define arrays if they are not needed.

No not really, even _ArrayCreate() has to create the array first.. might take a look at Eval() :whistle: ...

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Is it possible to do it without creating the array first? I need this to create an infinite number of arrays if needed. So i cound just have $count increase rather than have to define arrays if they are not needed.

Maybe it's an idea to explain a bit more what you need these Infinite Numbers of Arrays for; there might be a better approach to what you are trying to accomplish.

As Einstein said: the need for infinities in calculations often imply the use of too many dimensions. Or something along those lines, anyway... :whistle:

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Posted

Is it possible to do it without creating the array first? I need this to create an infinite number of arrays if needed. So i cound just have $count increase rather than have to define arrays if they are not needed.

Hi,

Not sure what you mean.. if you mean you can reuse the same array name with a different number of elements each [infinite numbers of.. ] time you use that array name, then each time , just

"redim $ar_Array[$i_Count]" to give it the correct size

Best, randall

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...