User Tools

Site Tools


simulating_20continue

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
simulating_20continue [2018/03/31 14:19]
127.0.0.1 external edit
simulating_20continue [2018/04/17 19:48]
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //by Richard Russell, November 2012//\\ \\  Some dialects of BASIC (e.g. Visual Basic) have a **CONTINUE** statement, which continues execution at the next iteration of a FOR, REPEAT or WHILE loop. It is equivalent to jumping to the NEXT, UNTIL or ENDWHILE statement (i.e. it skips the remainder of the 'body' of the loop).\\ \\  The same effect may be achieved in BBC BASIC by using a GOTO, but obviously that isn't very satisfactory. A better way is to use a dummy REPEAT...UNTIL TRUE loop as follows:\\ \\  //by Richard Russell, November 2012//\\ \\  Some dialects of BASIC (e.g. Visual Basic) have a **CONTINUE** statement, which continues execution at the next iteration of a FOR, REPEAT or WHILE loop. It is equivalent to jumping to the NEXT, UNTIL or ENDWHILE statement (i.e. it skips the remainder of the 'body' of the loop).\\ \\  The same effect may be achieved in BBC BASIC by using a GOTO, but obviously that isn't very satisfactory. A better way is to use a dummy REPEAT...UNTIL TRUE loop as follows:\\ \\ 
 +<code bb4w>
         WHILE some_condition         WHILE some_condition
           REPEAT           REPEAT
Line 9: Line 10:
           UNTIL TRUE           UNTIL TRUE
         ENDWHILE         ENDWHILE
 +</code>
simulating_20continue.txt ยท Last modified: 2022/04/23 10:38 by richardrussell