ListToWholeNumbers

From Second Life Wiki
Jump to navigation Jump to search

Function: list ListToWholeNumbers(list mylist);

Removes one item from a list.

See also: Lists

<lsl> list ListToWholeNumbers(list myList) {

   list myConvertedList = [];
   integer ListLength = llGetListLength(myList);
   integer f = 0;
   while (f <= (ListLength - 1)) {
       string w =llList2Key(myList, f);
       integer y = (integer)w;
       myConvertedList = (myConvertedList=[]) + myConvertedList + y;
       f=f+1;
       }
   return myConvertedList;

}

</lsl>

list myWholeNumberList = ListToWholeNumbers(1.04,10.789,4.643);
//yields [1,10,4]