Exemples de boucles
- Last UpdatedSep 24, 2024
- 1 minute read
Le script suivant utilise une boucle simple et une variable indirecte pour remettre à zéro 100 variables (Tag001 à Tag100).
DIM tmp AS INTEGER;
FOR Counter = 1 TO 100
IndirectInteger.Name = "Tag" + Text(Counter, "000");
IndirectInteger.Value = 0;
NEXT;
Le script suivant utilise deux boucles imbriquées et une variable indirecte pour remettre à zéro 1000 variables (Line01_Tag001 à Line10_Tag100).
DIM tmp AS INTEGER;
DIM tmp AS INTEGER;
FOR TagCounter = 1 TO 10
FOR TagCounter = 1 TO 100
IndirectInteger.Name = "Line" + Text(LineCounter, "00") + "_Tag" + Text(TagCounter, "000");
IndirectInteger.Value = 0;
NEXT;
NEXT;