LlListInsertList/ko

From Second Life Wiki
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.

설명

함수: list llListInsertList( list dest, list src, integer start );
200 함수ID
0.0 지연
10.0 에너지

반환되는 값은 deststart위치에서부터 src이 끼워넣어진 새로운 목록.

• list dest
• list src
• integer start

start음의 색인을 지원한다.

명세

색인 양의 방향 음의 방향
처음 0 -길이
길이 - 1 -1

만약 startdest의 마지막 보다 이전이라면, srcdest에 연결되며 공백(null) 항목을 더하지는 않는다. 이것을 피하기 위해서는, 목록의 처음 시작에 빈 항목들을 생성해야 한다. 음의 색인을 사용할 때도 비슷한 일이 발생한다.


예제

<lsl> list numbers = [3, "three", 2, "two", 1, "one"]; default {

   state_entry()
   {
       llOwnerSay(llDumpList2String(numbers, ","));
       // Object: 3,three,2,two,1,one
       integer index = llListFindList(numbers, [2]);
       if (index != -1)
       {
           numbers = llListInsertList(numbers, [2.5, "two and a half"], index);
           llOwnerSay(llDumpList2String(numbers, ","));
           // Object: 3,three,2.500000,two and a half,2,two,1,one
       }
   }

} </lsl>

기록

Bear in mind that the source list will remain unchanged. Instead, a new list will be produced. So, it's important that you capture this with a variable (unless you are acting directly on the results.)


Tip! To insert something at the start of a list, you can just add the two lists (putting the list with the new item(s) first)

<lsl> list oldList = ["B", "C", "D"]; list newItem = ["A"]; list newlist = newItem + oldList; </lsl>

함께 보기

함수

• llDeleteSubList
• llList2List
• llListReplaceList

문서

•  Negative_Index
이 글이 유용하지 않으세요? LSL Wiki의 관련항목이 도움을 줄 수 있을 지도 모릅니다.