ListItemDelete

From Second Life Wiki
Revision as of 15:58, 4 August 2008 by Chaz Longstaff (Talk | contribs)

Jump to: navigation, search

Function: list ListItemDelete(list mylist, string element);

Removes one item from a list.

See also: Lists

<lsl> list ListItemDelete(list mylist,string element_old) {

   list newlist;
   integer placeinlist = llListFindList(mylist, [element_old]);
   if (placeinlist != -1) {
       newlist = llDeleteSubList(mylist, placeinlist, placeinlist);
   }
   return newlist;

}

</lsl>

list myShortenedList = ListItemDelete(mylist,"Brown");