|
inimical Beginner
Joined: 12 Aug 2003 Posts: 14
|
Posted: Wed Nov 23, 2005 2:08 am
Parenthesis in %ismember |
It seems that %ismember doesn't notice parenthesis in lists it checks. For example:
#ADDI animals cow
#ADDI animals horse
#ADDI animals (pig)
#SHOW @animals --> cow|horse|(pig)
#IF %ismember(pig,@animals) {#SHOW Yes} {#SHOW No}
-->Yields "Yes" even though the actual value is (pig). It will also return true for #IF %ismember("(cow)",@animals)
Is there a way to get around this? |
|
_________________ |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Nov 23, 2005 2:45 am |
Not really. Parentheses are used to denote the presence of nested stringlists, so using them in general is simply not allowed.
However, in the case of a single-item element like "(pig)" they should probably be recognized as literal characters instead of special characters. For that reason I recommend adding this to the bug database. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Thu Nov 24, 2005 4:29 pm |
Maybe using it something along the lines of
"~(pig~)"
? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Nov 25, 2005 7:11 am |
Nope. It looks as though ZMud is stripping out the parentheses entirely when retrieving elements, probably so that nested stringlists don't have parentheses surrounding them that would then mess up any matches.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|