User:Void Singer/Functions

From Second Life Wiki
< User:Void Singer
Revision as of 17:17, 12 October 2010 by Void Singer (talk | contribs) (clean up)
Jump to navigation Jump to search

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.

uListFindAnyFirst

Get the First index in List Source of Any element in List Test

<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>

uListFindAnyLast

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>

Return to top

Questions or Comments?

Feel free to leave me a note on my User Talk page.