Break

From Scriptwiki
Revision as of 00:34, 7 April 2008 by Daveoh (talk | contribs)

Jump to: navigation, search

Breaks out of a while loop.

/break

Example

var %i = 1
while (1) {
  inc %i
  if (%i == 12) { break }
}
echo Break at %i

The above script would break out of the while loop when %i reached 12. If the script did not have a break command, it would turn into an infinite loop as the statement 1 will always be true.

See Also