|
solem Beginner
Joined: 16 Mar 2004 Posts: 20
|
Posted: Sat Oct 23, 2004 2:28 pm
Need Help with FUNCTION command out of zMud Help |
I would like to start using functions in my scripts. So I thought I would start with the example given in zMud Help.
#FU fact {%if(%1<=1,1,%1*@fact(%eval(%1-1)))}; #EVAL @fact(5); #SHOW @fact(5)
the output should be:
120 (for the #EVAL @fact(5))
and
5*4*3*2*1 (for the #SHOW @fact(5))
Instead I get the following output.
5*4*3*2*1
5*4*3*2*1
I have done searches in the forum but have not found much pertaining to this topic.
Any help is greatly apprieated.
Thank you in advance.
Solem |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Oct 23, 2004 3:42 pm |
Ok if I remember correctly this has been reported as a bug in #EVAL not recursivly expanding the arguments or something like that, I will double check it though but for now try this
#SHOW @fact(5)
5*4*3*2*1
#SHOW %eval(@fact(5))
120
EDIT: Yeah this has been reported as a bug so for now the last example I showed you is the exact same functionality of #EVAL |
|
|
|
|
|