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

Prior Evaluation(s) : Initdo

This evaluator can execute one or several operations prior to the iteration. It can be added as many optional inputs as necessary.

Adding the Box in the Editor

Contrary to EachTime and Finally, Initdo must be added in the editor by the user. To do so, Cmd click, type its name and validate, as for any other box.

Note that there can be only one Initdo box in the editor : the box can be added multiple optional inputs.

Press Alt + or to add or delete an input.

Example : Modifying a List Before an Enumeration

We'll send a message and reverse our list before the iteration begins.

On the left, Initdo is called internally before the iteration starts. It performs three evaluations :

  1. Input #1 evaluates a print box, which prints the original list

  2. Input #2 evaluates another print box, which prints the following message : "let's revers the list".

  3. Input #3 evaluates the reverse function, which reverses the original list.

Then, the iteration starts : Listloop enumerates the items of the reversed list returned by reverse . EachTime and Finally return the results of the iteration.

  1. At each step, EachTime evaluates a print box that prints a an item of the list

  2. At the end of the iteration, Finally returns the resulting list.

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