Difference between revisions of "While/fr"

From Second Life Wiki
Jump to navigation Jump to search
(Prepared for translation by Forest Klaar)
 
m (remise en forme de la parti code)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Multi-lang}}
{{Multi-lang}}
{{LSL_Conditional
{{LSL_Conditional/fr
|statement=while
|statement=while
|statement_header
|statement_header
|statement_desc=Any of the statements can be null statements.
|statement_desc=Chaque instruction 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 bloc d'instructions, ou un bloc vide.
|p1_name=condition|p1_desc=If this executes as true then '''loop''' is executed.
|p1_name=condition|p1_desc=Si la condition est évaluée à true, alors '''boucle''' est exécutée
|constants
|constants
|spec
|spec
|caveats
|caveats
|examples=<pre>//single statement
|examples=<source lang="lsl2">
//single statement
integer a = 0;
integer a = 0;
integer b = 10;
integer b = 10;
while(a < b)
while(a < b)
     llOwnerSay((string)(a++));
     llOwnerSay((string)(a++));
</pre>
</source>
<pre>//block statement
<source lang="lsl2">
//block statement
integer a = 0;
integer a = 0;
integer b = 10;
integer b = 10;
Line 24: Line 26:
     ++a;
     ++a;
}
}
</pre>
</source>
<pre>//null statement
<source lang="lsl2">
//null statement
integer a = 0;
integer a = 0;
integer b = 10;
integer b = 10;
while(a++ < b);
while(a++ < b);
</pre>
</source>
|helpers
|helpers
|also_header
|also_header
Line 36: Line 39:
|also_articles
|also_articles
|also_footer
|also_footer
|notes=A {{LSLG|do-while}} loop is faster than a while loop or a {{LSLG|for}} loop.
|notes=Une boucle {{LSLG|do-while/fr|do-while}} est plus rapide qu'une boucle while ou {{LSLG|for/fr|for}}.
|mode
|mode
|deprecated
|deprecated
|cat1=Conditional
|cat1=Conditional/fr
|cat2
|cat2
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 23:56, 25 July 2015

while( conditionboucle

•  condition Si la condition est évaluée à true, alors boucle est exécutée
•  boucle Peut être une instruction simple, un bloc d'instructions, ou un bloc vide.


Chaque instruction 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

//single statement
integer a = 0;
integer b = 10;
while(a < b)
    llOwnerSay((string)(a++));
//block statement
integer a = 0;
integer b = 10;
while(a < b)
{
    llOwnerSay((string)a);
    ++a;
}
//null statement
integer a = 0;
integer b = 10;
while(a++ < b);

Notes

Une boucle do-while est plus rapide qu'une boucle while ou for.