Skip to content

ForRange

Name Mandatory Description Default Type
⬅️ Input The input value is not used and will pass through unchanged. Any
Output ➡️ The output of this shard will be its input. Any
From No The initial iteration value (inclusive). 0 IntVar(Int)
To No The final iteration value (inclusive). 1 IntVar(Int)
Action No The action to perform at each iteration. The current iteration value will be passed as input. none Shard[Shard]None

Executes a series of shards while an iteration value is within a specified range (inclusive). Action input is the current index, not the input.

Examples

1
2
3
4
5
6
; Sum all positive integers below 1000
0 >= sum
ForRange(1 999 {
  Math.Add(sum) > sum
})
sum | Assert.Is(499500 Break: true)