HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Size of variable arrays?

06-25-2009, 06:31 AM#1
dismas
When I make a new variable array in the WE GUI, it lets you pick a size, but does it matter? I just left the size at 1, but I could still use array[1], array[2], etc.
06-25-2009, 01:22 PM#2
Vexorian
GUI is misleading here.

The size of all arrays is always 8192. The thing GUI calls 'size' means the number of indexes that will be initialized during init. For example, if you set the size of an array to 13 in GUI and the default value is -1, then all indexes of the array up to the [13] will have -1 initially. The other indexes will be 0.
06-25-2009, 09:28 PM#3
Silvenon
Quote:
The other indexes will be 0.

I thought other indexes aren't initialized.
06-25-2009, 09:45 PM#4
Vexorian
They aren't initialized, but that does not mean they aren't zero.

Arrays default to 0 / null/ false/ 0.0
06-25-2009, 09:47 PM#5
akolyt0r
Quote:
Originally Posted by Silvenon
I thought other indexes aren't initialized.

"not initialized" == "0"

but this is only true for arrays
06-27-2009, 10:36 AM#6
Silvenon
If you don't initialize a handle, is it "null" then?
06-27-2009, 12:56 PM#7
Vexorian
you could try it...
06-27-2009, 01:30 PM#8
DioD
this for gay types like groups and timers, since you cant realy create group or timer in gui.