Difference between revisions of "ListStridedMove"
Jump to navigation
Jump to search
m (<lsl> tag to <source>) |
|||
(8 intermediate revisions by 3 users not shown) | |||
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 | |||
|p4_type=integer|p4_name=stride | |||
|p5_type=integer|p5_name=target | |||
|return_type=list | |||
|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_footnote= | |||
<source lang="lsl2">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 * (end + 1)) - 1)); | |||
return llListInsertList(llDeleteSubList(myList, start, end), myList = item, target * stride); | |||
}</source> | |||
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=Examples | |||
|cat2=User-Defined Functions | |||
|cat3 | |||
|cat4 | |||
}} | |||
Latest revision as of 15:21, 22 January 2015
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 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 |
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 * (end + 1)) - 1));
return llListInsertList(llDeleteSubList(myList, start, end), myList = item, target * stride);
}
See also: Strided Lists