List Remove
Removes one element from an existing list variable. Use `where` to remove the `FIRST`, `LAST`, a zero-based `INDEX`, a zero-based `FROM_END` position, or a `RANDOM` element. If `where` is omitted, the block defaults to `LAST`. The `index` input is only used for `INDEX` and `FROM_END`. If `storeRemovedIn` is set, the removed value is written into that variable. Removing from an empty list or using an out-of-range index throws an error.
Inputs
| Input | Required | Value Kind | Types | Enum Values |
|---|---|---|---|---|
name | yes | string | — | — |
where | no | expression | enum-string | FIRST, LAST, INDEX, FROM_END, RANDOM |
index | no | expression | number | — |
storeRemovedIn | no | variable-name | — | — |
Notes
- Mutating statement for removing one value from a list variable.
wheremodes:FIRST: remove first element.LAST: remove last element.INDEX: remove element at zero-based index from start.FROM_END: remove element at zero-based position from end (index=0means last element).RANDOM: remove a random element.
- If
whereis omitted, behavior defaults toLAST. indexis only used forINDEXandFROM_END.- If
storeRemovedInis set, the removed value is written into that variable.
Examples
Traverse Nested Sequences With Deduped Worklist
Traverses the active sequence and nested sequences through a pending/seen worklist so nested sequence refs are not processed twice.
Topics: sequence traversal, nested sequences, clip iteration, lists
Source: patterns/ex-sequence-traverse-nested-deduped.json