Click or drag to resize

12.5.3.2 Loops and Repetitions within the current Command List

Loop Commands within current list

Loops are used to repeat all or part of a sequence of commands within the current list.

The repeated commands may, of course, include calls to sub-routines

  • Repeating a path exactly N times.

    Roughly equivalent to:
    for (var i = N; i > 0; --i) {    // LOOP_START N
    
    stuff();
    
    }    // LOOP_END
    
    // etc
  • Repeating a path up to a maximum of N times.

    Roughly equivalent to:
    for (var i = N; i > 0; --i) {    // LOOP_START N
    
    if (IOPort.Read() == CONDITION) goto lineNumStuff; // BRANCH_ABS_COND
    
    goto lineNumAfterEndOfLoop;            // LOOP_BREAK
    
    lineNumStuff:
    stuff();
    
    }    // LOOP_END
    
    lineNumAfterEndOfLoop:
    
    // etc

ListAPI Method

SP-ICE-3 Command

AppendLoopStart(Int32)

LOOP_START

AppendLoopEnd

LOOP_END

AppendLoopBreak

LOOP_BREAK