Posted: 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>
Posted: 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 >= 5then
Snum :=4
Ssub := -1 endif if Snum =1then
Ssub :=1 endif