The Control Structure: For
A control structure For is an item which implements iteration control of a group of items. An iteration is done from a given initial value to a given final value by a given step.
The group of operators is described in a subgraph. This subgraph can be opened by double-clicking on the item.
The number of inputs, outputs, and parameters are specified during the creation of the item. The number of parameter is at least 3, the three iteration values.
The first three parameters are named ($0, $1 et $2) and are used to:
Iteration is related to the following instruction:
for i=$0 to $1 step $2 do execute the related subgraph.
Other parameters $3, $4, ... are considered as constant in the iteration.
Composition of the subgraph
The group of items to iterate is composed in a subgraph.
The input, mask, parameter, and output slots of the control structure are accessible as connection slots in the subgraph:
For example, the graph above corresponds to the following snippet of code:
datafile1 = datafile(slot$0) for i in parameter$0 to parameter$1 step parameter$2 do r1=pmeanfiltering parameter$3 datafile1 datafile2 r2=test datafile2 datafile3 cp datafile3 datafile1 done cp datafile3 outputslot$0 resultslot$0 = r2
To enable execution, each output as well as the final result must be linked before execution, even directly with inputs slots.
Go to the reference manual