Computer Science Canada

Array Subscript Out of Range Error!

Author:  KukuriChan [ Mon Apr 12, 2004 6:33 pm ]
Post subject:  Array Subscript Out of Range Error!

I'm done making my game for comsci but somehow there's always an error that pops up that says that my array is out of range. I don't know why that happens. Can anybody help me?

Author:  Paul [ Mon Apr 12, 2004 7:50 pm ]
Post subject: 

Wow, its amazing. I just love the music.
I didn't get the error you said? can u explain more on how u got the error?
I played with 2 players, 3 planes each.
But this is really good, the music is great and you got the pieces to move in the right path lol Very Happy
One problem though, it runs really laggy on my computer, do you have it draw the board over and over again? cause mine flashes.
Good Job! Claping

Author:  gamer [ Mon Apr 12, 2004 8:58 pm ]
Post subject: 

hey i can tell its chinese music..haha
anyway, yea i tried the program n lot of flashin going on

Author:  KukuriChan [ Mon Apr 12, 2004 9:27 pm ]
Post subject: 

Embarassed Wow, thanks for the compliments. Really, you guys didn't get the error? Hm... Confused that's weird. Actually, the error doesn't pop up that often. See, every time I try moving a second plane out or keep moving the same pawn, the error "Array subscript out of range" error always occur. I don't know how I can fix it.

(I don't know how to keep it from flashing since I have to repeat the procedure over and over again. I was thinking of using view.update though but I don't really know where to put it so I made a loop that redraws the board every time. ^^;Wink

Author:  zeldamaster1230 [ Tue Apr 13, 2004 8:29 am ]
Post subject: 

for the View.Update, simply do this:

setscreen ("offscreenonly")
%coding goes here
end loop

that's pretty much it
three more lines
hope this helps!

Author:  recneps [ Tue Apr 13, 2004 2:47 pm ]
Post subject: 

array subscript means you are making a value larger than the array is set to hold... so just increase array size, or use flexible array and the "new" command to change the array size
(eg you're trying to fill the 26th spot when there are only 25 spots in the array)

Author:  KukuriChan [ Tue Apr 13, 2004 4:19 pm ]
Post subject: 

Zelda Master: thanks. IT worked. There's no more flashing anymore. ^^

Recneps : Yeah I increased the array size but there's still an error message going on.

Author:  recneps [ Wed Apr 14, 2004 4:09 pm ]
Post subject: 

try the debugger, run through it line by line, and try to get the error... maybe you can see whats goin on