Difference between revisions of "ListStridedMove"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 8: Line 8:
|p5_type=integer|p5_name=target
|p5_type=integer|p5_name=target
|return_type=list
|return_type=list
|return_text=that is myList with the strides in the range of '''start''' to '''end''' moved to the stride position '''target'''.
|return_text=that contains the elements of '''myList''' but with the strides in the range of '''start''' to '''end''' moved to the stride position '''target'''.
|func_desc=Moves a stride from one position to another position.
|func_desc=Moves a stride from one position to another position.
|func_footnote=
|func_footnote=

Revision as of 17:20, 14 July 2008

Summary

Function: list ListStridedMove( list myList, integer start, integer end, integer stride, integer target );

Moves a stride from one position to another position.
Returns a list that contains the elements of myList but with the strides in the range of start to end moved to the stride position target.

• list myList
• integer start
• integer end
• integer stride
• integer target

<lsl>list ListStridedMove(list myList, integer start, integer end, integer stride, integer target) {

   if(stride <= 0) stride = 1;
   list item = llList2List(myList, start *= stride, end = (((end + 1) * stride) - 1));
   return llListInsertList((myList = []) + llDeleteSubList(myList, start, end), item, destination * stride);

}</lsl>

See also: Strided Lists

Examples