ListItemDelete

From Second Life Wiki
Revision as of 16:58, 4 August 2008 by Chaz Longstaff (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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");