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

Username:   Password: 
 RegisterRegister   
 Array subscript is out of range
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Angelhan




PostPosted: Sat Oct 01, 2016 9:22 pm   Post subject: Array subscript is out of range

What is the problem you are having?
Every time I run my program it gives me an error saying array subscript is out of range, I do not know what the problem is and how to fix it. I am not sure but could the problem be from the images? I tried changing the background for my Scuba frames to solid white through gimp because the original gif was downloaded as transparent which turing does not support. However, one of the images did not turn out like the other 3, could that be the problem?

Btw it always highlights this code :
Sprite.ChangePic (ScubaSprite, scubaframes (Snum))


Please specify what version of Turing you are using
<4.1>



new.rar
 Description:

Download
 Filename:  new.rar
 Filesize:  8.34 MB
 Downloaded:  127 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
lordroba




PostPosted: Thu Oct 20, 2016 11:58 pm   Post subject: Re: Array subscript is out of range

You're resetting the value of Jnum and Jsub again in the second set of if statements instead of Snub and Ssub. Try replacing with the code below. Transparency needs to be fixed on frame '2' I believe.

Turing:

if Snum >= 5 then
        Snum := 4
        Ssub := -1
    end if
    if Snum = 1 then
        Ssub := 1
    end if
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  [ 2 Posts ]
Jump to:   


Style:  
Search: