Exit from a loop.

break

Terminates the loop (the closest enclosing loop in case of nested loops).

Example:

forever [
print repcount
if repcount = 5 [break]
]

Output:

1
2
3
4
5

See also:

Loop statements

Table of Content