LlListFindList/ko
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.
설명
함수: integer llListFindList( list src, list test );주의
- 유형 일치를 엄밀하게 해야하며 대소문자가 구별되니 주의하여야 한다.
예제
<lsl>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 } }
}</lsl>
유용한 조각
항목이 목록에 존재하는지를 알기 위한 한 가지 간단한 방법... <lsl>if(~llListFindList(myList, (list)item)) {//만약 존재한다면..
//원리는, ~(-1) == 0 이므로 동작하게 되는 것이다. //이런 방식은 바이트코드를 절약하며 != -1보다 실행 속도가 빠르다.
}</lsl>
함께 보기
함수
• | llSubStringIndex | – | 문자열에서 문자열 찾기 |
이 글이 유용하지 않으세요? LSL Wiki의 관련항목이 도움을 줄 수 있을 지도 모릅니다.