Application icon

Remove List Items at Index

This function removes one or more list elements at a specified index. The list can be in a named variable or field.

All text fields may contain any of the escape sequences described in Escape Sequences.

The list delimiter cannot be empty. If the delimiter resolves to be empty when the action is executed, nothing will be removed.

Note that where running stepwise the text fields are only processed for escape characters once based on the contents of the first file.

At runtime the index field must resolve to one of:

index
index,count

Both index and count are integers. count is the number of list items to remove and if omitted is assumed to be 1. If count is less than or equal to 0, no items will be removed.

The index is zero based and counts from the left. ie. 0 is the first element, 1 is the second, etc. Negative indexes count from the right. ie. -1 is the last element, -2 is the second to last element, etc. If the specified index resolves to be invalid, nothing will be removed. If count extends passed the end of the list it is not considered to be an error.

It is valid to specify the entire range in a named variable. The index field can contain \<range> as long as named variable range evaluates at runtime to one of the two valid forms.

The action test state will be set to true if anything is removed, otherwise false.