Shop OBEX P1 Docs P2 Docs Learn Events
Can't compile code for some reason (Something in the for loop) — Parallax Forums

Can't compile code for some reason (Something in the for loop)

quarkzquarkz Posts: 4
edited 2011-09-24 12:33 in BASIC Stamp
IF returnIni < 3 THEN ' returns for 3 turns and 3 fwrd paths
returnIni = returnIni + 1 'counter for foward and turns
RETURN
ELSEIF returnIni = 3 THEN
ENDIF
END

Even though returnIni =3 it still loops for some reason. What am i doing wrong?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-24 12:33
    You need to show your whole program. What you've shown should increment returnIni if it's less than 3 each time it's called with a GOSUB. When returnIni = 3, the program should stop because it falls through the ENDIF and ends up at the END.


    attachment.php?attachmentid=78421&d=1297987572
Sign In or Register to comment.