|
danilo Beginner
Joined: 27 May 2001 Posts: 12
|
Posted: 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 |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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. |
|
|
|
danilo Beginner
Joined: 27 May 2001 Posts: 12
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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 |
|
|
|
danilo Beginner
Joined: 27 May 2001 Posts: 12
|
Posted: 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. ;) |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: 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 |
|
|
|
danilo Beginner
Joined: 27 May 2001 Posts: 12
|
Posted: 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. |
|
|
|
|
|