Difference between revisions of "Continue"

From Scriptwiki
Jump to: navigation, search
 
 
Line 1: Line 1:
#redirect [[While_loops]]
+
Jumps to the beginning of a while loop.
 +
/continue
 +
Note that the while statements are also checked when using continue.
 +
==Example==
 +
[[var]] %i = 1
 +
[[while]] (%i) {
 +
  [[inc]] %i
 +
  [[if]] (%i < 12) { continue }
 +
  [[unset]] %i
 +
}
 +
[[echo]] While loop ended at %i
 +
The above loop will stop when %i reaches 12.
 +
==See Also==
 +
* [[Break|/break]]
 +
[[Category:Commands]]

Latest revision as of 01:35, 7 April 2008

Jumps to the beginning of a while loop.

/continue

Note that the while statements are also checked when using continue.

Example

var %i = 1
while (%i) {
  inc %i
  if (%i < 12) { continue }
  unset %i
}
echo While loop ended at %i

The above loop will stop when %i reaches 12.

See Also