OMLoop has two evaluators :
Finally
represents the output of OMLoop
. It is evaluated when the iterative process is over and
returns its final result(s)
.
If nothing is connected to it, the evaluation of OMLoop returns "nil".
The following example uses an iterator : listloop. at each step of a loop, listloop enumerates an element of a list, then the following element, and so on, until the list is exhausted.
| ![]() |
![]() | Finally has one default input : "patch". It can be added as many optional inputs as necessary : "oppatch". Optional inputs can be used as additional outputs for OMLoop to return data to external elements in a higher-level program. |
|
When an OMLoop has several outputs, it is advised to set it on "evaluate-once" mode to avoid useless multiple evaluations. When the OMLoop is evaluated, the result displayed by the Listener is that of the first output. |
EachTime
triggers successive evaluations
inside the OMLoop. It is not visible from the outside.
EachTime can apply to any type of operation, but the results won't be returned to other boxes or displayed, unless the user adds relevant connections.
![]() | EachTime has one default input, and can be added a number of optional inputs. Each input calls upstream boxes , so that several tasks can be performed at each step of the iteration. |
Here, EachTime evaluates om+ at each step of the loop. Yet, the Listener only displays the result of Finally when OMLoop is evaluated. | ![]() |
Yet, EachTime plays a very important part in an iteration, since it is the only means to evaluate and keep track of the results yielded at each step of the program. This is one of the main specificities and interests of OMLoop.
The results of the operations called by EachTime can actually be displayed and returned to other boxes, inside and outside the OMLoop module.
![]() | In this new example, print is evaluated at each step.
|
The results of the operations called by EachTime can be collected and returned to Finally with accumulators.
We want to gather the results of each loop of the iteration in a list and return this list to other boxes on the outside of the module.
To do so, we use an accumulator : collect .
Collect stores the results of each loop in a list.
At each step, eachtimes calls :
At the end, finally gets all the collected values and returns them as the result of the OMLoop.
Note : the editable-text-box displays the value of the OMLoop output.