HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Maximum Array Size for 2 Dimeansional Arrays Using Dynamic Arrays

09-15-2007, 10:23 AM#1
PandaMine
I was wondering what is the maximum possible array size for a 2 dimeansional array using JassHelpers dynamic array system i.e.

Collapse JASS:
type somearray extends integer array[what is the maximum size possible]
type somearray2 extends somearray array[what is the maximum size possible]

Obviously the maximum size possible for the first dimeansion is proportional to the second dimeansion, what would be the formula for calculating the maximum size
09-15-2007, 11:41 AM#2
botanic
i would think (i cant use JassHelper so I am not shure) the max would be 8192^2 because wc3 max array size is 8192, however I could easly be wrong :/
09-15-2007, 01:00 PM#3
cohadar
Maximum number of element in any array no mater how much dimensions it has is 8192

So you can have 1x8192, 2x4192, .. 32x256 or three dimensional 16x32x16

It does not matter, if you have MxN array, maxumum is MxN < 8192

(actually < 8191 because of blizz bug and actually < 8190 because of dynamic array implementation)
09-15-2007, 05:08 PM#4
Vexorian
for dynamic arrays the max size is 1000.

Quote:
Obviously the maximum size possible for the first dimeansion is proportional to the second dimeansion
it isn't.

Are you perhaps talking of max instance number?
09-15-2007, 11:59 PM#5
PandaMine
Woops sorry I got confused between max instance, but thanks heaps cohadar. Im trying to create item database for my system and this would help a lot

EDIT: What i really wanted to do is store abilities into a 2 dimeansional array. Frist index would hold an identifier for the ability (in this case an integer, since another array would like the integer with the ability id) and the second index would hold the level of the ability

Now the second index, being a level I would want to have a maximum size of around 20 (make it 30 to be sure) and the first index as big as possible so It can hold as many items as possible.

So what you are saying vexorian, that the maximum size for each dimeansion is 1000, so you can have a maximum of
Collapse JASS:
type somearray extends integer array[1000]
type somearray2 extends somearray array[1000]
09-16-2007, 12:19 AM#6
Vexorian
Yes, but max instance number of somearray is 8 and thus there are only eight different things you can place in somearray (9 if you count null)
09-16-2007, 12:40 AM#7
PandaMine
What exactly is meant by max instance?