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


Joined: 16 Mar 2004
Posts: 20

PostPosted: 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
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: 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
_________________
Zmud Support Library
Zmud Knowledge Base
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