From Second Life Wiki
Jump to: navigation, search

The code in the Examples section does not compile, as of 05-29-08, 11:54PM PDT:

<lsl>default {

       list a = ["a", "b", "e", "d"];
       list b = llListReplaceList(a, ["c"], 2, 2);//replace the range starting and ending at index 2 with ["c"] and store it into b

       llOwnerSay("\""+llList2CSV(a) + ""\""  ->  "\""" + llList2CSV(b)+"\"");//display the change
       //Will say: "a, b, e, d"  ->  "a, b, c, d"


I'm using the latest RC as of that date: 1.20 RC8. Compile fails at the second "\" character, giving "Syntax error"....

Please forgive the formatting of the default {} section; I can't figure out how to format the entire code block so that it looks right on the wiki, but all the code is there. --Welleran Kanto 12:01, 29 May 2008 (PDT)

Good catch, the quotes were overdone -- Strife Onizuka 14:11, 29 May 2008 (PDT)

The article mentions cleaning the variable before storing the list. (The list = (list=[]) + list... trick). I was under impression that this makes no difference under Mono. If so, it should probably be mentioned, to avoid people jumping through weird, unnecessary hoops. --Tali Rosca 23:20, 2 February 2009 (UTC)

"Returns a list that is dest with start through end removed and src inserted at start." is not true. If it was, you could add an element to a list that has three at index 50 and have that element at index 50 and not at index 3.

Any time list elements that do not exist are being accessed, an error should be yielded.

Ratany Resident 06:01, 10 February 2014 (PST)

This situation is adequately covered in the caveats. Omei Qunhua 06:29, 10 February 2014 (PST)