Array Index out of range in a line without array

Monkey Forums/Monkey Programming/Array Index out of range in a line without array

Yoda(Posted May) [#1]
I keep getting an "array index out of range" and it point to a codeline that doesn't even have an array, also not the line(s) before.

How can I find out where the problem is?


Goodlookinguy(Posted May) [#2]
Without code we can't help. You either have to improve your debugging skills or share at least the code that is on the call stack so that we can trace what's going on.


Yoda(Posted May) [#3]
I don't want you to debug my code, it's much too long.

I need a general advice how this error-system works, so if it shows this error in a line without any array in it, where to look instead. = improve my debugging skills ;-)


Gerry Quinn(Posted May) [#4]
At least show us the line, and we might have a clue! Normally, the way it works is that the error is on the reported line. [You don't have an editor with code folding that hides some lines?]

It could be mistaking something for an array, e.g. if you got the syntax wrong with string slicing or something.


MikeHart(Posted May) [#5]
So far TED oc Monkey-X never reported a different line number. Please show the line and the exact error message.

I could imagine you call into a Monkey object and THERE it throws up. For an example subframes of an image.


MikeHart(Posted May) [#6]
And make sure you run in debug mode. The error reporting out of the modules is better then.


Yoda(Posted May) [#7]
Interestingly, it disappeared. It was shown on a line that has only METHOD ... in it. After working on a different game and then coming back to this one, it compiles without the error. With no change in the code. Very strange.


EdzUp(Posted May) [#8]
it could have been a corrupted temp file, I have had it before its not monkeys fault it's windows writing of the temp files.


Yoda(Posted May) [#9]
I'm on Mac.


EdzUp(Posted May) [#10]
it's depending on how the temp file was written all files systems have a very small margin for error even OSX.