<text>The <code>for</code> loop is a very convenient loop with starting initialization. It is most often used as <ahref="#Zaehlschleife">counting loop</a>. It will take three statements as parameters, each separated by a ';' semicolon. Followed by the code block to be executed:</text>
<li>The first statement will be executed once at the beginning of the loop. This is a good place to initialize counter variables.</li>
<li>The second statement contains the loop condition. As soon as this condition returns 'false', the loop execution is stopped. The condition is checked before each loop execution.</li>
<li>The third statement is executed after each loop execution. This is a good place to count up or down your counter variables.</li>
</ul>
</text>
<text>It is possible to omit any of the three statements. If there is no condition statement, then the loop will run forever unless it is manually interrupted (i.e. using the <code>break</code> keyword). This is an infinite loop:</text>
<hid="Arrayschleife">Using for to iterate over an array</h>
<text>Another function of the <code>for</code>-loop is iterating over arrays. Each element of the array is stored in the variable and the loop body executed for that element. The script looks like this:</text>