# Loops

Next: Error Handing, Previous: Operators, Index: Index

Mesham supports the for and while loops.
for [variable] from [var/value] to [var/value]
{
body of loop
};
while ([condition)
{
body of loop
};
Again, { } and ( ) can be interchanged as braces, as you desire. Remember that the ending brace needs sequential composition after it. Like in many other languages, the keyword break can be used to break out of a loop. The for loop will loop until the variable is smaller or equal to the value - for instance if it is looping 0 to 0, then one iteration will be performed, 0 to 1 then two iterations will be performed.
Last Modified: August 2008