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: Mon May 19, 2003 1:46 pm   

[range]
 
i have an alias named test with the following command:

#if (%1 = "a|b|c|d|e|f|g") {#show %1 is in range} {#show %1 is not in range}

When i type test a, the result is always not in range. What is wrong with that alias, and how do i convert it to the form [a~g] to make it shorter?

Thanks in advance
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Mon May 19, 2003 3:17 pm   
 
I'd remove the set you're testing against into a variable, then use the %ismember function to do the actual testing.

Ana
Reply with quote
dskorren
Novice


Joined: 07 Feb 2002
Posts: 48
Location: Philippines

PostPosted: Mon May 19, 2003 3:33 pm   
 
So how do you use the [a~z] pattern matching from the help file? I would like to use it to check for uppercase letters so I can color them differently in the channel, ex: Capitals=yellow, Small Letter=dark cyan, and then punctuations=White. I cant use the %upper() because the function will return the same thing if the argument is a special character.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon May 19, 2003 4:11 pm   
 
In your first example, you are missing the curly braces. So it should be:
%1 =~ "{a|b|c|d|e|f|g}"

If you want to use a range, then you do it like this:
%1 =~ "[a-g]"

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon May 19, 2003 5:15 pm   
 
#TR upper {[A-Z]} {#CW yellow} {} {case}
#TR lower {[a-z]} {#CW cyan} {} {case}
#TR punct {%p} {#CW white} {} {case}

LightBulb
Advanced Member
Reply with quote
dskorren
Novice


Joined: 07 Feb 2002
Posts: 48
Location: Philippines

PostPosted: Mon May 19, 2003 5:22 pm   
 
Thank you very much Kjata and Lightbulb for your help. Much appreciated.
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