Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with llListReplaceList

Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
11-23-2005 07:36
As far as I can see from the wiki the syntax for llListReplaceList is:

llListReplaceList(list dest, list src, integer start, integer end)

In other words replacing in the destination list with a range from the source list. However an example I have seen is:

llListReplaceList(list dest, [value], integer start, integer end)

To me it looks like [value] is not a source list but more like an actual value or variable with a value in it.

Is this right. In other words if the parameter is in [] brackets it can be taken as a value and not a list?
October Brotherhood
Registered User
Join date: 24 Jun 2005
Posts: 70
11-23-2005 08:29
i think as long as you format value as a list you're ok, and i think that happens when you put the [] around it.
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
11-23-2005 13:17
Yes, October's right. [value] forces the VM to use value as an element in a list so it meets the right formating. (list)value does some funny things, certainly in llListFindList() and this format would also let you introduce serveral values as a list without precreating that list.

llListReplaceList(dest, [value], 0, 0);

is basically the same as

list temp+=value;
llListReplaceList(dest, temp, 0, 0);
Argent Stonecutter
Emergency Mustelid
Join date: 20 Sep 2005
Posts: 20,263
11-23-2005 16:24
From: Bobby Dayton
In other words if the parameter is in [] brackets it can be taken as a value and not a list?
The syntax of a list in second life is [value1,value2,value3,...]. Thus [value1,value2] is a list of two elements, and [value] is a list of one element.
Bobby Dayton
Test Pilot for Airfix
Join date: 15 Nov 2003
Posts: 206
11-23-2005 16:50
Thanks folks. Makes more sense now.