Jump to content

Array size


Recommended Posts

  • Developers

What is the maximum size of an AutoIT array variable? I am getting this error - "Array variable has incorrect number of subscripts or subscript dimension range exceeded.: ". I'm thinking my array is too big.

Arrays: A maximum of 64 dimensions and/or a total of 16 million elements

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

What is the maximum size of an AutoIT array variable? I am getting this error - "Array variable has incorrect number of subscripts or subscript dimension range exceeded.: ". I'm thinking my array is too big.

Post the code snipet that is generating the error. It is MUCH more likely you have a bad array reference syntax than your array is too big.

:shocked:

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

Is it possible that's only theoretical (the dimensions part)? I have a 100x100 array that seems to work fine.

I suspect what you have is a 2-D array:

Dim $avTest[100][100]

A 64-D array is left as an exercise for the student...

:shocked:

Edit: You can't declare all twenty dimensions with 100 indexes each because you get more than 16 million elements. If all the dimensions are 2 indexes each, you can still only get to 24 dimensions (2 ^ 24 = about 16M). To create an array with 64 dimensions and still have less than 16 million elements total, more than half the dimensions have to be a single index.

Hmmm...

Edited by PsaltyDS
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

LOL, When I try to visualize anything bigger than a 3D array I get a headache. I believe brain cells start smoking at that point.

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

Thank you for your timely responses - and very educational.

PsaltyDS was correct. I was For...Nexting to 100 but my array only contained 3 elements. Now I need to find out why it only has 3 elements. It should have thousands....

I'll post back if I get stuck again.

Thanks for the help.

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