Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Wed Jun 30, 2010 10:49 pm   

[3.21] BUG: #VARFUNC format(?) issue
 
This is fairly easy to duplicate, just use the example in the help file.

The following will create a database variable with '%if(%1<' as the key and '1,1,%1*@fact(%eval(%1-1)))' as the value:
Code:
#VARFUNC fact {%if(%1<=1,1,%1*@fact(%eval(%1-1)))}

JSON:
Code:
Variable: + fact                (Record)      %if(%1<=1,1,%1*@fact(%eval(%1-1)))
                       json: {"%if(%1<":"1,1,%1*@fact(%eval(%1-1)))"} (object)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jun 30, 2010 11:59 pm   
 
Yep, good catch. The parser is treating the {} as a string list/database variable like it does for #VAR which it's not supposed to do for #VARFUNC.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Jul 01, 2010 12:18 am   
 
Fixed for next version. And I should probably update the help file since the %eval is no longer needed in CMUD. The following works (in 3.22):
Code:
#VARFUNC fact {%if(%1<=1,1,%1*@fact(%1-1))}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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