I mentioned 3 lines higher that GetArrayHigh is mostly dedicated to dynamic arrays.
If you
SetArrayLength(my_array, 20)
and then
for i := 1 to 10 do my_array[i] := 1;
then GetArrayLength should return 20 and ArrayHigh 10 ( or 9, I can never remember that ).
that doesn't make any sense. All elements of the array have some value initially, the scriptcore doesn't care if you wrote the 0 there or if it was there initially. Arrayhigh should return 20
Edit: both only work on dynamic arrays btw (iirc). Why the hell would you want to get the length of a static array if you know it already because you define it yourself o.o One of the functions was added after the other one was found to generate errors on some systems. Can't recall which one exactly is faulty, so you're welcome to do some research and dig up old posts etc. Or just use the one you like and check if the script works fine :Р I personally used getarraylength, and don't recall that i had any troubles with it. Gotta note that dynamic arrays alone already seemed to make scripts unstable, but that is debatable (others say i'm just paranoid about it)
Edit2: oh yeah, and when i mentioned the scriptcore not knowing about the values in an array etc, i implied that the array elements are not set to some default value
as far as i know. So if you create an array, it is a good practice to reset all values to whatever you consider default. Because you could have anything in there depending on scriptcore's mood (checked and confirmed by getting access violations
). So if you meant that arrayhigh would return the index of the highest assigned element of the array,... there could be pretty much anything, and you could just as well get an error instead of an int that you desired :F