Don't click here unless you want to be banned.

LSL Wiki : llListFindList

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
integer llListFindList(list src, list test)

Returns the position (index) of the first instance of test in src (or -1 if test isn't in src).

When using this function, please remember that the type for src and test have to be the same, so typecast values in test to what they are expected to be in src if they're variables. Remember, this does include keys and strings!

If unsure what type the variables may be, use a for loop to check the output of llList2String() against the string to test for.

Example:
default {
    state_entry() {
        list src = ["The", "Quick", "Brown", "Fox", "Jumped", "Over", "The", "Lazy", "Dog"];
        list test;

        test = ["Brown"]; // What we want to find.
        integer foxColorIndex = llListFindList(src, test); // Returns 2.

        test = ["Jumped", "Over"];
        integer whatFoxDidIndex = llListFindList(src, test); // Returns 4.

        test = ["Quick", "Fox"];
        integer thereIsNoFox = llListFindList(src, test); // Returns -1.
    }
}

To do this with a string, use llSubStringIndex.

Q: How do I figure out the indexes of ALL instances of test?
A: There isn't a direct function to do this. Your best method is probably to do something like find out how many entries the list has using llGetListLength, then use a FOR loop, cutting out every instance of test, then replacing them after they've all been removed. If you can at all avoid it, use llListFindList to simply make sure you don't have any duplicates to begin with.
A2: Alternatively, if your list's order isn't important, you could use llListSort to put your list into alphabetical order, use llListFindList to get the index of the first entry, then simply incrementing by one until you stop finding matches. Obviously, if list order is important, this won't work.
A3: You can also use multiple instance of the llListFindList instead of doing a FOR loop for multiple choices.


This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Lists | Functions Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah
There is one comment on this page. [Display comments/form]