LSL Wiki Mirror 7-7-7 : llDeleteSubList

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
list llDeleteSubList(list src, integer start, integer end)

Returns a list equal to src without the slice defined by start and end. The start and end are inclusive, so 0, llGetListLength(src) - 1 would cause the function to return an empty list, and 0, 0 would cause the function to return a list equal to src without its first element. Using negative numbers for start and/or end causes the index to count backwards from the length of the list, so 0, -1 would cause the function to return an empty list. If start is larger than end the list returned is the exclusion of the entries, so 6, 4 would cause the function to return only src's 5th list entry.

IMPORTANT NOTE: This function does not manipulate src directly. To manipulate the list you pass as src, you must set src equal to the return value of this function.

Example:
list src = ["A", "B", "C"];
llDeleteSubList(src, 1, 1);
// ^^^ After this line, src is still ["A", "B", "C"] because the return value is discarded

src = llDeleteSubList(src, 1, 1);
// ^^^ After this line, src is ["A", "C"] because the return value is assigned to it

Compare with llListInsertList.


Lists | Functions
There is no comment on this page. [Display comments/form]