BCX Console Demonstration Program s118.bas

 DIM A, B
 
 CLS
 
 PRINT "This will print Iterations 7 thru 10 of the outer loop"
 PRINT "and will print the numbers 999 and 1000 from within"
 PRINT "the inner loop.  All 10,000 iterations still occur,"
 PRINT "it's the ADDED LEVEL OF CONTROL within your loops that "
 PRINT "ITERATE gives to you."
 
 FOR B = 1 TO 10
   IF B < 7 THEN ITERATE
   PRINT
   PRINT "<Outer Loop> Iteration Number", B
   FOR A = 1 TO 1000
     IF A < 999 THEN ITERATE
     PRINT ">Inner Loop< Iteration Number", A
   NEXT
 NEXT

Result:


 This will print Iterations 7 thru 10 of the outer loop
and will print the numbers 999 and 1000 from within
the inner loop.  All 10,000 iterations still occur,
it's the ADDED LEVEL OF CONTROL within your loops that
ITERATE gives to you.

  Iteration Number 7
 >Inner Loop< Iteration Number 999
 >Inner Loop< Iteration Number 1000

  Iteration Number 8
 >Inner Loop< Iteration Number 999
 >Inner Loop< Iteration Number 1000

  Iteration Number 9
 >Inner Loop< Iteration Number 999
 >Inner Loop< Iteration Number 1000

  Iteration Number 10
 >Inner Loop< Iteration Number 999
 >Inner Loop< Iteration Number 1000