Brightsign BrightScript 3.0 Reference Manual Manuel d'utilisateur Page 44

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 75
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 43
39
When program flow reaches the END FOR statement, the counter is incremented by the specified increment amount (or
decremented if increment is a negative value). If the STEP [increment] language is not included in the FOR
statement, the increment defaults to 1.
Use EXIT FOR to exit a FOR block prematurely.
Example: The following script decrements i at the beginning of each loop until it is less than 1.
for i=10 to 1 step -1
print i
end for
FOR EACH IN / END FOR
FOR EACH item IN object / END FOR
The FOR EACH statement can iterate through a set of items in any object that has an ifEnum interface (i.e. an
enumerator). The FOR block is terminated with the END FOR statement. Objects that are ordered intrinsically (such as
roList) are enumerated in order, while objects that have no intrinsic order (such as roAssociativeArray) are enumerated in
apparent random order. It is possible to delete entries as they are enumerated.
Use EXIT FOR to exit a FOR block prematurely.
The following objects can be enumerated: roList, roArray, roAssociativeArray, roMessagePort.
Example: The following script iterates over an associative array in random order, prints each key/value pair, then deletes
it.
aa={joe: 10, fred: 11, sue:9}
Vue de la page 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 74 75

Commentaires sur ces manuels

Pas de commentaire