Loop labels exist in GS2. They indicate to the VM where to jump to in break or continue statements. This is mainly useful if we have multiple loops, but we want to indicate which one to break / continue on:
function onCreated() {
outer:
for(temp.i = 0; temp.i < 5; temp.i++) {
for(temp.x = 0; temp.x < 5; temp.x++) {
if (temp.i == 3 && temp.x == 3) {
continue outer;
} else {
echo(temp.i SPC temp.x);
}
}
}
}
Loop labels exist in GS2. They indicate to the VM where to jump to in
breakorcontinuestatements. This is mainly useful if we have multiple loops, but we want to indicate which one to break / continue on: