Aide:ForInNext.txt
De Wiki AutoIt Français
Document original V3.3.6.1 :
###Keyword###
For...In...Next
###Description###
Enumerates elements in an Object collection or an array
###Syntax###
<b>For</b> <$Variable> <b>In</b> <expression>
<i>statements</i>
...
<b>Next</b>
###Parameters###
@@ParamTable@@
Variable
A variable to which an element is being assigned
expression
Must be an expression resulting in an Object, or an Array with at least one element
@@End@@
###Remarks###
The Variable will be created automatically with a LOCAL scope, even when MustDeclareVars is on.
If the expression is an Object collection with no elements, or an multi-dimensional array, the loop will be skipped and the Variable will contain an empty string.
If the expression is not an Object nor an Array, the script stops with an error, unless a COM Error handler had been configured.
Autoit Array's are read-only when using For...In. While you can assign the variable inside the For...In loop a value, this change is not reflected in the array itself. To modify the contents of an array during enumeration, use a For...To loop.
For...In...Next statements may be nested.
###Related###
<a href="With.htm">With...EndWith</a>
###Example###
@@IncludeExample@@
Document traduit V3.3.6.1 :
###Keyword###
For...In...Next
###Description###
Énumère des éléments dans une collection d'Objet ou un tableau
###Syntax###
<b>For</b> <$Variable> <b>In</b> <expression>
<i>statements</i>
...
<b>Next</b>
###Parameters###
@@ParamTable@@
Variable
Une variable à laquelle un élément est assigné
expression
Doit être une expression aboutissant à un Objet, ou un tableau avec au moins un élément
@@End@@
###Remarks###
La Variable sera créée automatiquement avec une portée LOCAL, même lorsque MustDeclareVars est utilisé.
Si l'expression est une collection d'Objet sans éléments, ou un tableau multidimensionnel, la boucle sera sautée et la Variable contiendra une chaîne vide.
Si l'expression n'est pas un Objet ou un Tableau, le script s'arrêtera avec une erreur, à moins qu'un Système de gestion d'exceptions COM n'ait été configuré.
Les tableaux AutoIt sont en lecture seul lors de l'utilisation de For...In. Tandis que vous pouvez assigner une valeur à la variable dans la boucle For...In, ce changement n'est pas reflété dans le tableau lui-même. Pour modifier le contenu d'un tableau pendant l'énumération,utilisez une boucle For...To.
Les déclarations For...In...Next peuvent être imbriquées.
###Related###
<a href="With.htm">With...EndWith</a>
###Example###
@@IncludeExample@@
Traducteur : Tlem