From Second Life Wiki
for/fr
for( initialiseur; condition; incrément ) boucle
| •
| initialiseur
| –
| Exécuté une fois juste avant l'évaluation de condition.
|
|
| •
| condition
| –
| Si condition est vraie, alors boucle est exécutée.
|
|
| •
| incrément
| –
| Exécuté juste après boucle, puis retour sur condition.
|
|
| •
| boucle
| –
| Peut être une instruction simple, un ensemble d'instruction ou l'instruction vide.
|
|
Chacune des instructions peut être l'instruction vide.
|
|
|
Exemples
// instruction unique
integer a = 0;
integer b = 10;
for (; a < b; ++a)
llOwnerSay((string) a);
// ensemble d'instructions
integer a = 0;
integer b = 10;
for (; a < b; ++a)
{
llOwnerSay((string) a);
llOwnerSay((string) a);
}
// instruction vide
integer a = 0;
integer b = 10;
for (; a < b; llOwnerSay((string) (a++)));
|
Notes
Un for boucle est identique à un while boucle qui suit le schéma :
initialiseur;
while (condition)
{
boucle;
incrément;
}
|
For