Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Searching through a List

Erectous Mayo
Registered User
Join date: 27 Jun 2007
Posts: 4
07-26-2007 10:48
I have a list of strings. The strings contain names of people that have permission to an object. How would I compare the list with llKey2Name( person )? Thx :)
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
07-26-2007 11:22
From: Erectous Mayo
I have a list of strings. The strings contain names of people that have permission to an object. How would I compare the list with llKey2Name( person )? Thx :)


//
CODE

list users = ["Strife Onizuka", "Dan Linden", ""Erectous Mayo"];
string find = "Strife Onizuka";

integer index = llListFindList(users, (list)find);
if(~index)
{//Found
llOwnerSay("Found: '"+find+"' at position " + (string)index);
}
else
{//Not found
llOwnerSay("Didn't find: '"+find"'");
}

//


Why not store the UUID's of the users in the list?
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Erectous Mayo
Registered User
Join date: 27 Jun 2007
Posts: 4
Excellent
07-26-2007 11:29
That did the trick!!!

Many thx :)