THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/12/2012 at 07:42, xxxxxxxx wrote:
Also a word of warning from me about the GeAutoDynamicArray.
The Auto version is a bad one to use when you're experimenting with arrays and haven't gotten your code locked down. Or if you are a newish code writer like me.
After doing a bit of array work with it recently I discovered that this array will do unexpected things to the indexing of itself if you do too many things to it like Insert, Push, etc...
If you're going to be doing a lot of array manipulation beyond the simple adding or subtracting from the end of the array. Then I personally recommend using the GeDynamicArray instead. That way you won't run into any surprises with the array indexing.
You'll have to free the memory by hand: gDelete(myArray);
But IMHO I think it's worth the trouble. Because the indexes will always be what you expect them to be at all times. With no surprises.
When you're already struggling with figuring out the code for other tasks. The last thing you need is an array automatically changing it's indexing secretly in the background. And tricking you into thinking you have a bug in your other code.
A lesson learned by me the hard way.