label

The label statement is used to assign a unique name to a block of executable statements, the purpose of which is to allow break and continue statements within a deeply nested executable structure to stop executing and exit to a higher level in the heirarchical tree of executable statements. The script may then begin again at some level higher than that in which the break or continue was invoked.

syntax:

labelName:

EXAMPLE

loopLabel:

for (arguments) {

for (arguments) {

if (arguments) {

break loopLabel;

}

}

}

The example shows that the label name is 'loopLabel'. Several for statements and one if statement later, the 'break loopLabel;' is given, which tells the script to jump to the loopLabel: and begin again.