Difference between revisions of "For"

From Wiki
Jump to: navigation, search
(removed TOC, fixed description, added to see also.)
m (Example: adding halt makes it easier to see the effect. otherwise you get euo looping anyway.)
Line 21: Line 21:
 
msg %i $
 
msg %i $
 
wait 10
 
wait 10
}</pre>
+
}
 +
halt</pre>
  
 
=== See Also ===
 
=== See Also ===

Revision as of 16:27, 24 August 2005

Synopsis

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

Description

The for command controls a loop that iterates a variable over a range of numbers. Both positive and negative iterations are legal.

The variable is assigned the starting number to begin with. After each iteration it either increments or decrements the variable, until it reaches the ending number.

In EasyUO 1.4, you must use brackets, even if there is only a single line of code in a for loop. In EasyUO 1.5 however, brackets are optional if the for loop is only a single line of code.

Example

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

See Also

while repeat..until continue break |

Main_Page Documentation Flow Control