Difference between revisions of "ListStridedMove"
Jump to navigation
Jump to search
(it had nothing to do with strides.) |
|||
Line 1: | Line 1: | ||
{{ | {{LSL_Function | ||
|mode=user | |||
== | |func=ListStridedMove | ||
|p1_type=list|p1_name=myList | |||
== | |p2_type=integer|p2_name=start | ||
|p3_type=integer|p3_name=end | |||
Moves | |p4_type=integer|p4_name=stride | ||
|p5_type=integer|p5_name=target | |||
|return_type=list | |||
|return_text=that is myList 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_footnote= | |||
<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 *= stride); | |||
return llListInsertList((myList = []) + llDeleteSubList(myList, start, end), item, destination * stride); | |||
}</lsl> | |||
See also: [[List#Strided_lists|Strided Lists]] | See also: [[List#Strided_lists|Strided Lists]] | ||
|spec | |||
|helpers | |||
|also_functions | |||
|also_events | |||
|also_tests | |||
|also_articles | |||
|notes | |||
|cat1=Example | |||
|cat2 | |||
|cat3 | |||
|cat4 | |||
}} | |||
Revision as of 17:16, 14 July 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
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 is myList 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 *= stride); return llListInsertList((myList = []) + llDeleteSubList(myList, start, end), item, destination * stride);
}</lsl>
See also: Strided Lists