LlListFindList/ko
From Second Life Wiki
Second Life Wiki > LlListFindList/ko
예제
list numbers = [1, 2, 3, 4, 5]; default { state_entry() { integer index = llListFindList(numbers, [3]); if (index != -1) { list three_four = llList2List(numbers, index, index + 1); llOwnerSay(llDumpList2String(three_four, ",")); // Object: 3,4 } } }
유용한 조각
항목이 목록에 존재하는지를 알기 위한 한 가지 간단한 방법...
if(~llListFindList(myList, (list)item)) {//만약 존재한다면.. //원리는, ~(-1) == 0 이므로 동작하게 되는 것이다. //이런 방식은 바이트코드를 절약하며 != -1보다 실행 속도가 빠르다. }
이 글이 유용하지 않으세요? LSL Wiki의 관련항목이 도움을 줄 수 있을 지도 모릅니다.

