Aide:Switch.txt
De Wiki AutoIt Français
Document original V3.3.6.1 :
###Keyword###
Switch...Case...EndSwitch
###Description###
Conditionally run statements.
###Syntax###
<b>Switch</b> <expression>
<b>Case</b> <value> [To <value>] [,<value> [To <value>] ...]
<i>statement1</i>
...
[<b>Case</b> <value> [To <value>] [,<value> [To <value>] ...]
<i>statement2</i>
...]
[<b>Case</b> Else
<i>statementN</i>
...]
<b>EndSwitch</b>
###Parameters###
@@ParamTable@@
<expression>
An expression that returns a value. The value from the expression is then compared against the values of each case until a match is found. This expression is always evaluted exactly once each time through the structure.
<value> To <value>
The case is executed if the expression is between the two values.
<value>
The case is executed if the expression matches the value.
@@End@@
###Remarks###
If no cases match the Switch value, then the Case Else section, if present, is executed. If no cases match and Case Else is not defined, then none of the code inside the Switch structure, other than the condition, will be executed.
Switch statements may be nested.
###Related###
<a href="If.htm">If...Then</a>, <a href="IfElseEndIf.htm">If...Else...EndIf</a>, <a href="Select.htm">Select...EndSelect</a>, ContinueCase
###Example###
@@IncludeExample@@
Document traduit V3.3.6.1 :
###Keyword###
Switch...Case...EndSwitch
###Description###
Exécute des déclarations Conditionnelles.
###Syntax###
<b>Switch</b> <expression>
<b>Case</b> <value> [To <value>] [,<value> [To <value>] ...]
<i>statement1</i>
...
[<b>Case</b> <value> [To <value>] [,<value> [To <value>] ...]
<i>statement2</i>
...]
[<b>Case</b> Else
<i>statementN</i>
...]
<b>EndSwitch</b>
###Parameters###
@@ParamTable@@
<expression>
Une expression qui retourne une valeur. La valeur de l'expression est alors comparée avec les valeurs de chaque cas jusqu'à ce qu'une concordance soit trouvée. Cette expression est toujours évaluée une fois par structure.
<value> To <value>
Le cas est exécuté si l'expression est entre les deux valeurs.
<value>
Le cas est exécuté si l'expression correspond à la valeur.
@@End@@
###Remarks###
Si aucun cas ne correspond à la valeur du Switch, alors la section Case Else (si présente) est exécutée. Si aucun cas ne correspond et que Case Else n'est pas définit, alors, aucun code à l'intérieur de la structure du Switch autre que la condition, ne sera exécuté.
Les déclarations Switch peuvent être imbriquées.
###Related###
<a href="If.htm">If...Then</a>, <a href="IfElseEndIf.htm">If...Else...EndIf</a>, <a href="Select.htm">Select...EndSelect</a>, <a href="ContinueCase.htm">ContinueCase</a>
###Example###
@@IncludeExample@@
Traducteur : Tlem