Moleculor Satyr
Fireflies!
Join date: 5 Jan 2004
Posts: 2,650
|
09-12-2004 12:08
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: Object: 4 Object: -4 What. The. Hell? This makes comparing a chunk of one list against another list impossible. (EDIT: Lemme clarify.) 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: 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? 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?
|
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>
|