User:Void Singer/Functions
uListFindListLast
- This function is a companion to llListFindList.
- SPECIAL NOTE: this is only designed to work on string data that will NOT contain the "•" character(alt+7)... please use a different character to suit your needs.
Get Last Index of List Test in List Source <lsl>integer uListFindListLast( list vLstSrc, list vLstTst ){
integer vIdxFnd =
(vLstSrc != []) +
([] != vLstTst) +
([] != llParseString2List(
llList2String(
llParseStringKeepNulls(
llDumpList2String( vLstSrc, "•" ),
(list)llDumpList2String( vLstTst, "•" ),
[] ),
-1 ),
(list)"•",
[] ));
return (vIdxFnduListFindAny*
- These functions are companions to llListFindList.
- SPECIAL NOTE: this is only designed to work on string data that will NOT contain the "•" character(alt+7)... please use a different character to suit your needs.
<lsl>integer uListFindAnyFirst( list vLstSrc, list vLstTst ){
return ((llParseString2List(
llList2String(
llParseStringKeepNulls(
llDumpList2String( vLstSrc, "•" ),
vLstTst, [] ),
0 ),
(list)"•", [] ) != []) + 1) %
((vLstSrc != []) + 1) - 1;
} /*//-- Anti-License Text --//*/ /*// Contributed Freely to the Public Domain without limitation. //*/ /*// 2009 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ /*//-- --//*/</lsl>
Get the Last index in List Source of Any element in List Test<lsl>integer uListFindAnyLast( list vLstSrc, list vLstTst ){
return (vLstSrc != []) -
(llParseString2List(
llList2String(
llParseString2List(
llDumpList2String( vLstSrc, "•" ),
vLstTst, [] ),
-1 ),
(list)"•",
[] ) != []) - 1;
} /*//-- Anti-License Text --//*/ /*// Contributed Freely to the Public Domain without limitation. //*/ /*// 2009 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ /*//-- --//*/</lsl>