Difference between revisions of "ListStridedRemove"

From Second Life Wiki
Jump to navigation Jump to search
m (Added details..)
m (fixed my <lsl> issue :P should have used preview)
Line 12: Line 12:
<lsl>
<lsl>
// to remove indexs from a list (normaly one thats been strided use this function
// to remove indexs from a list (normaly one thats been strided use this function
<lsl>list ListStridedRemove(list src, integer start, integer end, integer stride) {
list ListStridedRemove(list src, integer start, integer end, integer stride) {
     return llDeleteSubList(src, start * stride, (stride * (end + 1)) - 1);
     return llDeleteSubList(src, start * stride, (stride * (end + 1)) - 1);
}</lsl>
}</lsl>
<lsl>
// to remove every stride from a list use this function
// to remove every stride from a list use this function
list ListStridedRemove(list src, integer start, integer end, integer stride)
list ListStridedRemove(list src, integer start, integer end, integer stride)

Revision as of 07:19, 16 December 2009

Summary

Function: list ListStridedRemove( list src, integer start, integer end, integer stride );

Removes a specified part of a strided list.
Returns a list that contains the elements of myList but with the strides in the range of start to end removed.

• list src
• integer start
• integer end
• integer stride

<lsl> // to remove indexs from a list (normaly one thats been strided use this function list ListStridedRemove(list src, integer start, integer end, integer stride) {

    return llDeleteSubList(src, start * stride, (stride * (end + 1)) - 1);

}</lsl> <lsl> // to remove every stride from a list use this function list ListStridedRemove(list src, integer start, integer end, integer stride) {

   // fixed and improved by Madpeter Zond (the wiki entry is trash please update it)
   if((start < 1)

Examples

<lsl>list customers = ListStridedRemove(customers, 0, 0, STRIDELENGTH);</lsl>