Difference between revisions of "For"

From Wiki
Jump to: navigation, search
(Synopsis)
Line 18: Line 18:
 
wait 10
 
wait 10
 
}</pre>
 
}</pre>
 +
 +
=== See Also ===
 +
{|
 +
| width=200px | [[break]] || width=200px | [[while]] || width=200px | [[continue]]
 +
|}
 +
----
 +
{|
 +
| Width=200px | [[Main_Page]] || Width=200px | [[Documentation]] || Width=200px | [[Documentation#Flow_Control|Flow Control]]
 +
|}

Revision as of 10:59, 18 August 2005

Synopsis

for {variable} {start} {end}
{
  ...
}

Description

The for command controls a loop that iterates a variable over a range of numbers (both up or down works).

The loop starts assigning the variable with the starting number, there after for each loop it either increments or decrements the variable, until it reaches the ending number.

Example

for %i 1 20
{
	msg %i $
	wait 10
}

See Also

break while continue

Main_Page Documentation Flow Control