Difference between revisions of "ListStridedUpdate"

From Second Life Wiki
Jump to: navigation, search
m
Line 1: Line 1:
{{LSL Header}} __NOTOC__
+
{{LSL_Function
<div id="box">
+
|mode=user
== Function: [[list]] ListStridedUpdate( [[list]] {{LSL Param|dest}}, [[list]] {{LSL Param|src}},
+
|func=ListStridedUpdate
[[integer]] {{LSL Param|start}}, [[integer]] {{LSL Param|end}}, [[integer]] {{LSL Param|stride}} ) ;
+
|p1_type=list|p1_name=dest
==
+
|p2_type=list|p2_name=src
<div style="padding: 0.5em;">
+
|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=
 +
<lsl>list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) {
 +
    return llListReplaceList(dest, src, start * stride, ((end + 1) * stride) - 1 );
 +
}</lsl>
  
 
See also: [[List#Strided_lists|Strided Lists]]
 
See also: [[List#Strided_lists|Strided Lists]]
 
+
|examples=
<lsl>
+
<lsl>list customers = ListStridedUpdate(customers, update, 0, 0, STRIDELENGTH);</lsl>
list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) {
+
|spec
    return llListReplaceList(dest, src, start * stride, end * stride + (stride - 1) );
+
|helpers
}
+
|also_functions
 
+
|also_events
 
+
|also_tests
</lsl>
+
|also_articles
 
+
|notes
 
+
|cat1=Examples
</div>
+
|cat2
 
+
|cat3
{{LSLC|Examples|ListStridedUpdate}}
+
|cat4
 +
}}

Revision as of 16:39, 14 July 2008

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

<lsl>list ListStridedUpdate(list dest, list src, integer start, integer end, integer stride) {

   return llListReplaceList(dest, src, start * stride, ((end + 1) * stride) - 1 );

}</lsl>

See also: Strided Lists

Examples

<lsl>list customers = ListStridedUpdate(customers, update, 0, 0, STRIDELENGTH);</lsl>