Difference between revisions of "ListStridedUpdate"
Jump to navigation
Jump to search
m (<lsl> tag to <source>) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LSL_Function | ||
|mode=user | |||
== | |func=ListStridedUpdate | ||
|p1_type=list|p1_name=dest | |||
= | |p2_type=list|p2_name=src | ||
|p3_type=integer|p3_name=start | |||
Updates part of a strided list. | |p4_type=integer|p4_name=end | ||
|p5_type=integer|p5_name=stride | |||
|return_type=list | |||
|return_text=that contains the elements of '''dest''' but with the strides in the range of '''start''' to '''end''' replaced with all the elements from '''src'''. | |||
|func_desc=Updates part of a strided list. | |||
|func_footnote= | |||
<source lang="lsl2">list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) { | |||
return llListReplaceList(dest, src, start * stride, ((end + 1) * stride) - 1 ); | |||
}</source> | |||
See also: [[List|Lists]] | See also: [[List#Strided_lists|Strided Lists]] | ||
|examples= | |||
< | <source lang="lsl2">list customers = ListStridedUpdate(customers, update, 0, 0, STRIDELENGTH);</source> | ||
list ListStridedUpdate( | |spec | ||
|helpers | |||
|also_functions | |||
|also_events | |||
|also_tests | |||
|also_articles | |||
|notes | |||
|cat1=Examples | |||
|cat2=User-Defined Functions | |||
|cat3 | |||
|cat4 | |||
}} |
Latest revision as of 14:22, 22 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: list ListStridedUpdate( list dest, list src, integer start, integer end, integer stride );
Updates part of a strided list.
Returns a list that contains the elements of dest but with the strides in the range of start to end replaced with all the elements from src.
• list | dest | |||
• list | src | |||
• integer | start | |||
• integer | end | |||
• integer | stride |
list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) {
return llListReplaceList(dest, src, start * stride, ((end + 1) * stride) - 1 );
}
See also: Strided Lists
Examples
list customers = ListStridedUpdate(customers, update, 0, 0, STRIDELENGTH);