break
| Syntax |
break
|
| Action |
Terminates the innermost for, loop, fileloop, or while statement in which it is contained. Script execution continues at the next statement following the looping construct, skipping any subsequent statements within the current loop body.
|
| Examples |
fileloop (fName in folderPath) if file.isLocked (fName) lockedFileFound = true break ++numberOfFiles
if lockedFileFound
This is just a script fragment, so don't attempt to execute it. A loop like the one above might be used to count the number of files in a folder about to be deleted, so that a confirmation dialog could be presented to the user. However, since a locked return (false) if x == 16396 break msg ("Try again!")
This is just a script fragment, so don't attempt to execute it. This loop prompts the user for a number forever, until he or she exhibits astonishing clairvoyance or gets sick of the game. The break statement allows the loop to be terminated if the user |
| Notes |
The break statement only terminates the loop that contains it; loops outside of the innermost loop continue to execute as usual.
|
| See Also |
for
|