Rule/when behavior has string comparison bug
spacechimp
Member Posts: 9
The contains directive is part of the when behavior. Unfortunately when comparing strings, the "contains" directive does not work. It appears to only work on an exact match, effectively behaving like "is". For example:
game.TestAttribute="1234"
when game.TestAttribute contains 2
This will return false. This is incorrect, it should return true.
However, an exact match works, for example:
game.TestAttribute="1234"
when game.TestAttribute contains 1234
This does return true as it should.
I also tried various wildcard characters such as * and that does not work either. So basically the "contains" directive behaves like the "is" directive. It cannot be used to perform comparisons/lookups of substrings.
game.TestAttribute="1234"
when game.TestAttribute contains 2
This will return false. This is incorrect, it should return true.
However, an exact match works, for example:
game.TestAttribute="1234"
when game.TestAttribute contains 1234
This does return true as it should.
I also tried various wildcard characters such as * and that does not work either. So basically the "contains" directive behaves like the "is" directive. It cannot be used to perform comparisons/lookups of substrings.
Comments
http://gamesalad.com/forums/topic.php?id=2861
(just linking the two posts a bit)
Wait a minute, you were in that other post. I guess you are just making an offical bug post! :-) Oh heck!