NEVER USE THESE.
@LOOP 'CODE GOTO @LOOP
@LOOP GCLS GOSUB @GAME GOSUB @RENDER WAIT 1 GOTO @LOOP @GAME 'CODE RETURN @RENDER 'CODE RETURN
Root / Submissions / [.]
@LOOP 'CODE GOTO @LOOP
@LOOP GCLS GOSUB @GAME GOSUB @RENDER WAIT 1 GOTO @LOOP @GAME 'CODE RETURN @RENDER 'CODE RETURN
FOR (variable)=(value 1) TO (value 2) STEP (step) PRINT "Hi! ";(variable) NEXT
FOR I=0 TO 3 STEP 2 PRINT "Hi! ";I NEXTenter that code and see what happens. try changing one thing. try removing the STEP.
FOR I=0 TO 3 BGSCREEN I,127,128'(or I,64,64) NEXT /the rest of map loading code
'the rest of map loading code
FOR I=0 TO 3 BGSCREEN I,127,128'(or I,64,64) NEXT /the rest of map loading code
FOR I=0 TO 3 BGSCREEN I,127,128'(or I,64,64) NEXT /the rest of map loading code
FOR I=0 TO 3 BGSCREEN I,127,128 NEXTcan be accomplished with this literal jump:
VAR I = 0 @LOOP_1 BGSCREEN I,127,128 DEC I, -1 'for "speed" IF I <= 3 THEN GOTO @LOOP_1In addition, a finite loop can be "unwrapped" by writing out every instruction.
BGSCREEN 0,127,128 BGSCREEN 1,127,128 BGSCREEN 2,127,128 BGSCREEN 3,127,128The counting "FOR" loop allows us to not worry about iterator variables, it handles the increment itself. Most of the "debate" occurring in the comments here seems to be DSM not bothering to learn structures like this. I'm sure he'll choose the unwrapped version when checking all 512 sprites--after all, it's faster that way.
FOR I=0 TO 3 BGSCREEN I,127,128'(or I,64,64) NEXT /the rest of map loading code