Siebel eScript Language Reference > Siebel eScript Language Overview > Siebel eScript Statements >

break Statement

The break statement terminates the innermost loop of for, while, or do statements. It is also used to control the flow within switch statements.

Syntax A


Syntax B

break label;



The name of the label indicating where execution is to resume


The break statement is legal only in loops or switch statements. In a loop, it is used to terminate the loop prematurely when the flow of the program eliminates the need to continue the loop. In the switch statement, it is used to prevent execution of cases following the selected case and to exit from the switch block.

When used within nested loops, break terminates execution only of the innermost loop in which it appears.

A label may be used to indicate the beginning of a specific loop when the break statement appears within a nested loop to terminate execution of a loop other than the innermost loop. A label consists of a legal identifier, followed by a colon, placed at the left margin of the work area.


For an example, read switch Statement.

See Also

do...while Statement
for Statement
if Statement
while Statement

Siebel eScript Language Reference