|
Domneth Dingson
Registered User
Join date: 20 Nov 2006
Posts: 126
|
08-08-2007 00:25
There isn't as much info on lists on the wiki as I'd like. I'm plugging along, but if anyone has any good examples of 'everything about lists'.
I'd appreciate being pointed in the proper direction. I think the hardest thing I'm having trouble with is removing items from a list right now.
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
08-08-2007 00:37
I don't believe it's so much the WIKI lacking on explaining lists, but rather that lists aren't as versatile as people first expect (many expect array-like functionality).
To delete something from a list, use llDeleteSubList().
Example:
lsample = llDeleteSubList(lsample, 0, 1);
The above example would remove the 1st and 2nd entry from list lsample.
If you don't know the position of a particular variable that you want to delete, run something like:
x = llListFindList(lsample, [data]); if(x != -1) lsample = llDeleteSubList(lsample,x,x);
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
|
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
|
08-08-2007 03:46
The scary part is that eventually one gets used to such indignities as the equivalent of an array operation such as: arrayVar ++;
being something like:
listVar = llListReplaceList(listVar, [llList2Integer(listVar, i) + 1], i, i);
(and then hunting around for why heap is fragmenting). 
|
|
Domneth Dingson
Registered User
Join date: 20 Nov 2006
Posts: 126
|
08-08-2007 07:27
From: Kenn Nilsson I don't believe it's so much the WIKI lacking on explaining lists, but rather that lists aren't as versatile as people first expect (many expect array-like functionality).
To delete something from a list, use llDeleteSubList().
Example:
lsample = llDeleteSubList(lsample, 0, 1);
The above example would remove the 1st and 2nd entry from list lsample.
If you don't know the position of a particular variable that you want to delete, run something like:
x = llListFindList(lsample, [data]); if(x != -1) lsample = llDeleteSubList(lsample,x,x); oops. I had been trying to use a substring query, thinking that was better, based on some wording in one of the wikis. I'll go this path instead, it'll probably solve what I was having trouble with. As always, thanks for the input.
|