Quote: "Ah, you are trying to insert the value 5 at index 0 but index 0 does not exist. This is the same as using an index larger than the size of the array. You are basically out of bounds."
Yes, I know why this is failing. As I point out, since the array is empty, an insertion at either the front or the rear of the array will locate the new element at index zero, so I would not expect insert(value, 0) to fail on an empty array as the end result is exactly what I ask for- the new element is index 0. I cannot use insert(value) in my code as all new elements need to go into the start of the array and insert(value) places elements at the end according to the AppGameKit online help. Also, when my code is called I cannot make assumptions about the length of the array; it can be either empty or not empty. As a workaround I was forced to do this:
myArray as integer
if myArray.length > -1
insert(value, 0)
else
insert(value)
endif
Goo Goo G\'Joob!