Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
inimical
Beginner


Joined: 12 Aug 2003
Posts: 14

PostPosted: 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?
_________________
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
darkspot
Apprentice


Joined: 29 Jul 2002
Posts: 105

PostPosted: Thu Nov 24, 2005 4:29 pm   
 
Maybe using it something along the lines of
"~(pig~)"
?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net