Difference between revisions of "ListStridedUpdate"

From Second Life Wiki
Jump to navigation Jump to search
m (<lsl> tag to <source>)
 
(One intermediate revision by one other user not shown)
Line 11: Line 11:
|func_desc=Updates part of a strided list.
|func_desc=Updates part of a strided list.
|func_footnote=
|func_footnote=
<lsl>list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) {
<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 );
     return llListReplaceList(dest, src, start * stride, ((end + 1) * stride) - 1 );
}</lsl>
}</source>


See also: [[List#Strided_lists|Strided Lists]]
See also: [[List#Strided_lists|Strided Lists]]
|examples=
|examples=
<lsl>list customers = ListStridedUpdate(customers, update, 0, 0, STRIDELENGTH);</lsl>
<source lang="lsl2">list customers = ListStridedUpdate(customers, update, 0, 0, STRIDELENGTH);</source>
|spec
|spec
|helpers
|helpers
Line 26: Line 26:
|notes
|notes
|cat1=Examples
|cat1=Examples
|cat2=UD_Functions
|cat2=User-Defined Functions
|cat3
|cat3
|cat4
|cat4
}}
}}

Latest revision as of 14:22, 22 January 2015

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);