indexOfElement(list, value)

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

indexOfElement(list, value)

Post by Bushmills » 17 Nov 2014 21:56

I suggest addition of another form of IndexOfElement, namely IndexOfElement((list, value, index), which starts looking for element in list fromon index.

IndexOfElement(list, value), as provided now, would be identical to IndexOfElement(list, value, 0)

Apart from better symmetry with IndexOf(..), this also simplifies running through a list, selecting matching elements only, for example when counting Number of matching list elements (I suppose I could also copy list, then iteratively remove the first matching element from copy until no match left, or removeElementValue from copy, then subtract resulting list length from original list length). Still, many cases where another than the first matching element is meant to be referenced, should benefit.

Locked