Difference between revisions of "TrimList"

From Second Life Wiki
Jump to navigation Jump to search
(Added desirable feature- compilablity...)
Line 5: Line 5:
list TrimList(list dlist, integer length)  
list TrimList(list dlist, integer length)  
{
{
     integer dlist = llGetListLength(dlist)+1;
     integer i;
    integer dl = llGetListLength(dlist);
     list temp = [];
     list temp = [];
     while(~--dlist)
     while(~--dl)
         temp += llGetSubString(llList2String(dlist,i),0, length-1);
         temp += llGetSubString(llList2String(dlist,i++),0, length-1);
     return temp;
     return temp;
}
}

Revision as of 03:15, 2 September 2013

this function will trim a list of strings for the output of a dialog box.

Function <lsl> list TrimList(list dlist, integer length) {

   integer i;
   integer dl = llGetListLength(dlist);
   list temp = [];
   while(~--dl)
       temp += llGetSubString(llList2String(dlist,i++),0, length-1);
   return temp;

}

</lsl>