SplitScript reference / Iterable
Iterable
capability
capability Iterable
Creates an Iterator over a value without consuming that value.
Arrays, sets, and integer ranges provide this capability. The iterator is a first-class value with its own cursor, so it can be stored or passed to a helper independently of the source collection.
Examples
Iterate over a value
state "game.exe" {}
onAttach {
for value in [1, 2] {
print(value)
}
}
Methods
| Member | Description | Available through |
|---|---|---|
| iterator | Creates an independent cursor over this value. |