CIGAL Reference Manual, Chapter 2 (Commands): BREAK

BREAK -- Break out of a loop of conditional code

usage: break [N]

The BREAK command is used to exit from a block of conditional code within a WHILE or REPEAT loop in a CIGAL macro program. BREAK has no effect if called anywhere except within a loop. BREAK causes a jump to the end of the loop (indicated by a '}' command) and then continues, without going back up to test the WHILE condition again. The argument, N, indicates how many loops to jump out of (default: N=1). If N is givenm, it must be a constant, not a variable, because its value is read at compile time (rather than run time as for most arguments).

For example:

             while(a-- > 10) {
                b = a*c+d
                if(b > 100) break            ; skip next 8 lines
                type 'B=' b
                while(c++ < 20) {
                    if(d > 0) break 2    ; skip next 5 lines
                    if(b > 10) break     ; skip next 2 lines
                    type a b c d
                }
                type 'D=' d++
             }

See Also:
MACROS(1), NEXT(2), REPEAT(2), WHILE(2)

CIGAL Home, CIGAL Manual, Commands List, Manual Help