DefData, ReadData... help.

BlitzMax Forums/BlitzMax Beginners Area/DefData, ReadData... help.

I tried it again this time in debug mode and it tracked the error this time. is a stuped mistake on my part:

when I created array info, I made it 5 elements in size. that number is stored in the "length" part of the array.
But when the program tried to read the data with the for loop, it was reading 0 to 5 which is 6 elements. The true array size is 0 to 4 which is five elements. So the for loop should read like this:
For Local i= 0 To info.length-1

the same go for the other 2 "for" statements
I fixed it in the second example but didn't pay attention on the first one.
I have edited the code and it works fine now.

I guess it only catches the error in debug mode. weird!