 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: 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) |
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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))} |
|
|
|
|
 |
|
|
|
|
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
|
|