|
Diag Anzac
Registered User
Join date: 27 Oct 2006
Posts: 45
|
02-15-2008 18:09
Ok, this should be simple, but I've been trying to get it right for hours and am having no luck.
I have a list :
list foo = ["green", "blue", "red", "pink", "orange"]
I want to change the 3rd item, "red", to "cheeseburger", leaving all the other items intact.
It looks like I need to use llListReplaceList. How would I do this? Whatever I try, I keep losing items off the end of the list.
I've tried ...
foo = llListReplaceList(foo, ["cheeseburger"], 2, 1);
and
foo = llListReplaceList(foo, ["cheeseburger"], 2, 5);
.... and several other iterations, but none are working. I've also tried playing with llDeleteSubList and llListInsertList, but it all just seems so complicated for something that should be simple.
Thanks for any help.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
02-15-2008 18:50
foo = llListReplaceList(foo, ["cheeseburger"], 2, 1); The 1st number after ["cheeseburger"], is the start of what you are replacing and the number following that is the end. In this case you are replacing everything from 2 to 1, which is the whole list. You only want to replace 2 so do it like this:
foo = llListReplaceList(foo, ["cheeseburger"], 2, 2);
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Diag Anzac
Registered User
Join date: 27 Oct 2006
Posts: 45
|
02-15-2008 21:59
Thank you Jesse 
|