Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llList2List comparison

Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
09-12-2004 12:08
CODE
list set = ["la","de","da","de"];
list data = [];

default
{
state_entry()
{
llSay(0, (string)(llList2List(set,0,3) != data));
llSay(0, (string)(data != llList2List(set,0,3)));
}
}


Output:

CODE
Object: 4
Object: -4


What. The. Hell? This makes comparing a chunk of one list against another list impossible. (EDIT: Lemme clarify.)

CODE
list set = ["la","de","da","de"];
list data = [];

default
{
state_entry()
{
if(llList2List(set,0,3) != data & TRUE)
{
llSay(0,"Yay!");
}
else
{
llSay(0,"Boo!");
}
}
}


Output:

CODE
Object: Boo!


Since &&'s are depreciated, according to Wiki, I should only be using &'s, right?
(EDIT: Damnit, I could have SWORN I saw that boolean stuff was depreciated in favor of bitwise. Am I going crazy?)
_____________________
</sarcasm>
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
Re: llList2List comparison
09-12-2004 12:23
From: someone
Originally posted by Moleculor Satyr
Since &&'s are depreciated, according to Wiki, I should only be using &'s, right?


What? Where did you see that? That's not the case, I can assure you. Edit: Oh, I see you've realized that as well. :)

Second, why are you using them at all?

CODE
list set = ["la","de","da","de"];
list data = [];

default
{
state_entry()
{
if (llList2List(set,0,3) != data)
{
llSay(0,"Yay!");
}
else
{
llSay(0,"Boo!");
}
}
}


Doesn't this function correctly?
_____________________
Need scripting help? Visit the LSL Wiki!
Omega Point - Catherine Omega's Blog
Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
09-12-2004 13:13
Yes, that functions correctly. It's a TRUE statement. But it's NOT TRUE. It's 4. Or -4. Which screws with bitwise comparisons. Which doesn't make sense to me. Which means if I ever bitwise compare it to something else, the if() statement is ALWAYS false. No matter what.
_____________________
</sarcasm>