Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Find The Location of Something in a List?

Nyx Alsop
Registered User
Join date: 14 Dec 2008
Posts: 252
11-19-2009 16:17
If I had a list that contains say apple

How can I find what element number apple is? as in where in the list it comes?

Thanks.
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
11-19-2009 16:19
Doing this..

list fud = ["carrot", "bananna", "apple", "sheep"];

integer position = llListFindList (fuds, ["sheep"]);

...should set position to 3. You'll get back a -1 if it's not in there.
_____________________
Sick of sims locking up every time somebody TPs in? Vote for SVC-3895!!!
- Go here: https://jira.secondlife.com/browse/SVC-3895
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
11-19-2009 16:49
From: Nyx Alsop
If I had a list that contains say apple

How can I find what element number apple is? as in where in the list it comes?

Thanks.
Before you start asking questions about every single LSL function may I suggest you consult the wiki or the wakka:
http://wiki.secondlife.com/wiki/LSL_Portal
http://www.lslwiki.net/lslwiki/wakka.php?wakka=HomePage
_____________________
From Studio Dora
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
11-19-2009 17:08
Inworld, in the script editor, the Include button shows you a list of functions, events, etc. This can sometimes save the need to look anywhere else. There's a way to to get the scripting help to display the word under the cursor in the wiki, which is useful.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-