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
ragbash
Newbie


Joined: 08 Mar 2008
Posts: 3

PostPosted: Sun Mar 16, 2008 3:00 pm   

Pattern Matching / Alias
 
I'm confused..

I am trying to script intuitive ftp functions for zmud, but I can't seem to get parameter checks working right.
For instance:
#if (%ends( %1, ".c") or %ends( ".h", %1)) returns true if there are no arguments passed to the alias, so I try this:
#if (%1 and (%ends( %1, ".c") or %ends( ".h", %1)))
which seems to do the same..

Any suggestions on better parameter checking?

Thanks,
-Olorin
Dune Mud
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Mar 16, 2008 4:54 pm   
 
Code:
#if (%numparam and (%ends( %1, ".c") or %ends( %1,".h"))) {vrai} {faux}


On second look your original was on the right track, you just switched the arguments of the second %ends
change
#if (%ends( %1, ".c") or %ends( ".h", %1))
to
#if (%ends( %1, ".c") or %ends( %1, ".h"))
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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