llListFindListNext(haystack, needle, instance);
Returns the index for the Nth
instance
of
needle
.
instance
is zero-based.
Returns -1 when there aren't enough instances.
Error: Returns
last index + 1
when
needle
is the last element of the list.
integer index;
list haystack = ["A", "B", "C"];
index = llListFindListNext(haystack, ["C"], 0); // OK
llSay(PUBLIC_CHANNEL, "Expect 2: " + (string)index);
index = llListFindListNext(haystack, ["B"], 1); // OK
llSay(PUBLIC_CHANNEL, "Expect -1: " + (string)index);
index = llListFindListNext(haystack, ["C"], 1);
llSay(PUBLIC_CHANNEL, "Expect -1: " + (string)index);
index = llListFindListNext(haystack, ["C"], 23);
llSay(PUBLIC_CHANNEL, "Expect -1: " + (string)index);