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
dskorren
Novice


Joined: 07 Feb 2002
Posts: 48
Location: Philippines

PostPosted: Sat Jun 28, 2003 1:21 pm   

checking a character to a range of characters
 
i have an alias named test with the value:

#if ("%1" =~ "[abcd]") {#show %1 is in range} {#show %1 is not in range}

why does test a and test A will always result to in range?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jun 28, 2003 4:14 pm   
 
The answer is obvious, isn't it? zMUD ignores case in this comparison. Add a separate test for case.
#IF ("%1" =~ "[abcd]" AND "%1" = %lower("%1")) {#SHOW %1 is in range} {#SHOW %1 is not in range}

If this were for a trigger instead of an alias, you could probably just enable the Case option.
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