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
danilo
Beginner


Joined: 27 May 2001
Posts: 12

PostPosted: Tue Feb 10, 2004 9:31 pm   

multiple parameters
 
Hi,

I have been using Tinyfugue extensively on my Linux box, and was wondering if Zmud has this particular feature that I like about it.

alias score %{*-verbose}

Hitting > score will send "score verbose", while > score brief will send "score brief".

I can do this with an #IF statement in Zmud, yes. But I was wondering if anyone knew of the Zmud equivalent of the elegant script( %{*-verbose} ) above. I can't find it in the manual.

Thanks. :)

Dan
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Feb 10, 2004 11:22 pm   
 
I can only think of an if check.

#alias score {~score %if(%numparam()=0,"verbose","%-1")}

Edit changed brief to verbose. Need coffee.
Reply with quote
danilo
Beginner


Joined: 27 May 2001
Posts: 12

PostPosted: Wed Feb 11, 2004 1:17 am   
 
Cool, I didn't know that.

What's the difference between using #IF and %if? I've always used #IF before.

Thanks.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Feb 11, 2004 3:10 am   
 
From the helpfiles

%if expression is true, return the true-value otherwise return the false-value.


#if Allows conditional execution. If the expression is true, then the true-command is executed. If the expression is false, then the false-command (which is optional) is executed.


~score %if(%numparam()=0,"verbose","%-1")
%IF Num of params = 0 return score verbose else return score params you typed in after score
Reply with quote
danilo
Beginner


Joined: 27 May 2001
Posts: 12

PostPosted: Wed Feb 11, 2004 3:22 am   
 
Nexela, the two examples you posted seem totally identical to me. :)

How does

#alias score {~score %if(%numparam()=0,"verbose","%-1")}

differ from

#alias score {#if (%1) {~score %-1} {~score verbose}}

... for example. Is there a reason to use one over the other?

Hope you can make something more out of it than quoting helpfiles. ;)
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Feb 11, 2004 4:55 am   
 
Well I didnt say the other way wouldnt work did I :P I explained the differance between #if and %if
%if Returns something
#if Does something
Reply with quote
danilo
Beginner


Joined: 27 May 2001
Posts: 12

PostPosted: Wed Feb 11, 2004 5:39 am   
 
But but... %if does something too!

No wait, I think I get what you are saying. Neat!

Thanks.
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