\b;Instruction \c;for\n;
Syntaxe:
\s;\c;for ( avant ; condition ; fin )
\s;{
\s;	\n;Instructions ...\c;
\s;}
\n;
Cette structure de boucle permet d'exécuter plusieurs fois les instructions comprises dans le \l;bloc\u cbot\bloc;.

\t;\c;avant\n;
This set of instructions is executed before the first loop instance.

\t;\c;condition\n;
Cette \l;condition\u cbot\cond; détermine s'il faut continuer la boucle. Elle est examinée avant chaque tour de boucle, y compris le dernier.

\t;\c;fin\n;
This set of instructions is executed at the end of every instance of the loop. 

Example: count from 1 to 4
\c;\s;\c;for ( i = 1 ; i <= 4 ; i++ )
\s;{
\s;	message(i) ;
\s;}
\n;
L'instruction \c;for\n; est rigoureusement équivalente à l'exemple suivant, utilisant \c;\l;while\u cbot\while;\n;:
\s;\c;avant;
\s;while ( condition )
\s;{
\s;	\n;Instructions ...\c;
\s;	fin;
\s;}
\n;
\t;Attention
Il ne faut pas mettre un \l;point-virgule\u cbot\term; à la fin de la ligne \c;for ( )\n;.

Les instructions \c;\l;break\u cbot\break;\n; et \c;\l;continue\u cbot\continue;\n; sont utiles à l'intérieur d'un bloc \c;for { }\n;.

\t;Executing more instructions
In the \c;before\n; and \c;end\n; part of a \c;for\n; loop you can specify more than one instruction by using comma. Example:
\c;
\s;int i = 0;
\s;int j;
\s;for (i++, j = 2; i < 3 && j > 0; i++, j--)
\s;{
\s;    message(i);
\s;    message(j);
\s;}
\n;
The output of the above code is \c;1 2 2 1\n;.

\t;Voir aussi
\l;Programmation\u cbot;, \l;types\u cbot\type; et \l;catégories\u cbot\category;.

