Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Array Subscript Out of Range Error!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
KukuriChan




PostPosted: 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?


Flight.zip
 Description:
Go into taketurns.t to play. ^^ There's the main error.

Download
 Filename:  Flight.zip
 Filesize:  263.36 KB
 Downloaded:  208 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Mon Apr 12, 2004 7:50 pm   Post subject: (No 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
gamer




PostPosted: Mon Apr 12, 2004 8:58 pm   Post subject: (No subject)

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




PostPosted: Mon Apr 12, 2004 9:27 pm   Post subject: (No 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
zeldamaster1230




PostPosted: Tue Apr 13, 2004 8:29 am   Post subject: (No subject)

for the View.Update, simply do this:

setscreen ("offscreenonly")
loop
cls
%coding goes here
View.Update
end loop

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




PostPosted: Tue Apr 13, 2004 2:47 pm   Post subject: (No 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)
KukuriChan




PostPosted: Tue Apr 13, 2004 4:19 pm   Post subject: (No 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.
recneps




PostPosted: Wed Apr 14, 2004 4:09 pm   Post subject: (No subject)

try the debugger, run through it line by line, and try to get the error... maybe you can see whats goin on
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: