Difference between revisions of "For/fr"

From Second Life Wiki
< For
Jump to navigation Jump to search
(Prepared for Translation by Olivier Hildyard)
 
m (Fixed category)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Multi-lang}}
{{Multi-lang}}
{{LSL_Conditional
{{LSL_Conditional/fr
|statement=for
|statement=for
|statement_header
|statement_header
|statement_desc=Any of the statements can be null statements.
|statement_desc=Chacune des instructions peut être l'instruction vide.
|statement_end=loop
|statement_end=boucle
|statement_end_desc=Can be either a single statement, a block statement, or a null statement.
|statement_end_desc=Peut être une instruction simple, un ensemble d'instruction ou l'instruction vide.
|p1_name=initializer|p1_desc=Executed once just before checking '''condition'''.
|p1_name=initialiseur|p1_desc=Exécuté une fois juste avant l'évaluation de '''condition'''.
|p2_name=condition|p2_desc=If this executes as true then '''loop''' is executed.
|p2_name=condition|p2_desc=Si '''condition''' est vraie, alors '''boucle''' est exécutée.
|p3_name=increment|p3_desc=Executed after '''loop''', then '''condition''' is checked again.  
|p3_name=incrément|p3_desc=Exécuté juste après '''boucle''', puis retour sur '''condition'''.  
|constants
|constants
|spec
|spec
|caveats
|caveats
|examples=<pre>//single statement type.
|examples=<pre>// instruction unique
integer a = 0;
integer a = 0;
integer b = 10;
integer b = 10;
for(; a < b; ++a)
for (; a < b; ++a)
     llOwnerSay((string)a);
     llOwnerSay((string) a);
</pre>
</pre>
<pre>//block statement
<pre>// ensemble d'instructions
integer a = 0;
integer a = 0;
integer b = 10;
integer b = 10;
for(; a < b; ++a)
for (; a < b; ++a)
{
{
     llOwnerSay((string)a);
     llOwnerSay((string) a);
     llOwnerSay((string)a);
     llOwnerSay((string) a);
}
}
</pre>
</pre>
<pre>//null statement
<pre>// instruction vide
integer a = 0;
integer a = 0;
integer b = 10;
integer b = 10;
for(; a < b; llOwnerSay((string)(a++)));
for (; a < b; llOwnerSay((string) (a++)));
</pre>
</pre>
|helpers
|helpers
Line 38: Line 38:
|also_articles
|also_articles
|also_footer
|also_footer
|notes=A for loop is the same as a while loop as below.
|notes=Un '''for boucle''' est identique à un '''while boucle''' qui suit le schéma :
<pre>
<pre>
initializer;
initialiseur;
while(condition);
while (condition)
{
{
     loop;
     boucle;
     increment;
     incrément;
}
}
</pre>
</pre>
|mode
|mode
|deprecated
|deprecated
|cat1=Conditional
|cat1=Conditional/fr
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 05:03, 4 December 2007

for( initialiseur; condition; incrémentboucle

•  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.

Spécification

Conditions par type
Type Condition
integer Vrai si non nul.
float Vrai si non nul.
string Vrai si sa longueur est non nulle.
key Vrai seulement s'il s'agit d'une clé valide et différente de NULL_KEY.
vector Vrai si le vecteur est différent de ZERO_VECTOR.
rotation Vrai si la rotation est différente de ZERO_ROTATION.
list Vrai si sa longueur est non nulle.


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;
}