Difference between revisions of "User:Void Singer/Functions"
Void Singer (talk | contribs) m (updated) |
Void Singer (talk | contribs) m (clean up) |
||
Line 5: | Line 5: | ||
{{void-box | {{void-box | ||
|title= | |title=uListFindListLast | ||
|content= | |content= | ||
* This function is a companion to [[llListFindList]]. | * 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. | ** '''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 | <lsl>integer uListFindListLast( list vLstSrc, list vLstTst ){ | ||
integer vIdxFnd = | integer vIdxFnd = | ||
(vLstSrc != []) + | (vLstSrc != []) + | ||
Line 34: | Line 34: | ||
{{void-box | {{void-box | ||
|title= | |title=uListFindAny* | ||
|content= | |content= | ||
* These functions are companions to [[llListFindList]]. | * 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 | <div style="display:none"><h3>uListFindAnyFirst</h3></div>'''Get the First index in List Source of Any element in List Test''' | ||
<lsl>integer uListFindAnyFirst( list vLstSrc, list vLstTst ){ | |||
return ((llParseString2List( | return ((llParseString2List( | ||
llList2String( | llList2String( | ||
llParseStringKeepNulls( | llParseStringKeepNulls( | ||
llDumpList2String( vLstSrc, " | llDumpList2String( vLstSrc, "•" ), | ||
vLstTst, [] ), | vLstTst, [] ), | ||
0 ), | 0 ), | ||
(list)" | (list)"•", [] ) != []) + 1) % | ||
((vLstSrc != []) + 1) - 1; | ((vLstSrc != []) + 1) - 1; | ||
} | } | ||
Line 54: | Line 55: | ||
/*//-- --//*/</lsl> | /*//-- --//*/</lsl> | ||
= | <div style="display:none"><h3>uListFindAnyLast</h3></div>'''Get the Last index in List Source of Any element in List Test''' | ||
<lsl>integer | <lsl>integer uListFindAnyLast( list vLstSrc, list vLstTst ){ | ||
return (vLstSrc != []) - | return (vLstSrc != []) - | ||
(llParseString2List( | (llParseString2List( | ||
llList2String( | llList2String( | ||
llParseString2List( | llParseString2List( | ||
llDumpList2String( vLstSrc, " | llDumpList2String( vLstSrc, "•" ), | ||
vLstTst, [] ), | vLstTst, [] ), | ||
-1 ), | -1 ), | ||
(list)" | (list)"•", | ||
[] ) != []) - 1; | [] ) != []) - 1; | ||
} | } | ||
/*//-- Anti-License Text --//*/ | /*//-- Anti-License Text --//*/ |
Revision as of 16:17, 12 October 2010
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 (vIdxFnd
uListFindAny*
- 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>