Skip While¶
Skip While skips items from a list as long as a predicate is true. The predicate is specified itself as a graphical pipeline. The predicate is evaluated for each item of the list, beginning with the first item. As long as the predicate evaluates to true, list items are skipped. As soon as the predicate evaluates to false, the iteration is stopped, and the remaining items are put in the output list.
Outside View¶
At the outside, the Skip While node appears like a single node, with inputs and outputs.
Inside View¶
Inside, the Skip While node looks like a normal branched pipeline. This pipeline is used to specify the predicate, which is evaluated for each item, until the predicate turns false.
Comments¶
Skip While nodes can be nested in similar ways as subpipelines.
The nesting is shown with a breadcrumbs control at the top.
Double-click a Skip While node to enter it, and use the breadcrumbs control to exit it and go up one or more levels.
By default, a Skip While node has one input and one output.
You can add additional inputs with the Add Input (Ctrl-I) command. You can edit the port names by clicking on them and typing a new name. The type of the ports is determined by the first connection made to them, either from the outside or from the inside.
Sample¶
Here is an example:
It skips items from the first list (0, 1, …, 9) while the predicate (< 3) is true and returns the resulting list (3, 4, …, 9).