Recherche Google
OpenMusic DocumentationOM 6.6 User Manual > Visual Programming II > Iterations: OMLoop > Iterators > For Loop
page précédentepage suivante

ForLoop : Enumeration Between Two Values

General Properties

ForLoop enumerates each element of a list from a minimum value – starting point – to a maximum value – ending point – by a default step of 1, and stops once the maximum value is exceeded.

Forloop has two default inputs and one optional input :

  • "from" and "to" : a starting and and ending vlaue
  • "by" : the value of the enumeration step.
  • Forloop can only handle and return numbers :it cannot enumerate an existing list - see ListLoop).
  • The value of "from" must always be inferior to the value of "to".
  • The default value of "by" is 1. It can be replaced by another positive value . If this value is negative, forloop doesn't stop, because "to" would never be reached.

Example : a List with a 7 step

ForLoop stops the iteration when the value defined by "to" is exceeded. Here, the first value returned by finally is the first value which exceeds the maximum value.

page précédentepage suivante
A propos...(c) Ircam - Centre PompidouRéalisé avec Scenari