Thank you both!  this opens up A Whole New World (begin singing
now :-)

I don't know why it took me so long to find/notice wikiCalc, and those
links, Mario, will come in handy when I start getting (trying) into
more complicated scripting (by the time I'm eighty, I'll be a whiz -
but then there'll be AI Erics & Marios floating around to help us with
our coding by then, right?)

On Aug 11, 3:38 am, Eric Shulman <[email protected]> wrote:
> > your score is <<wikiCalc "0+(%1*1)+(%2*1)+(%3*1)+(%4*1)+(%5*1)" "one@"
> > "two@" "three@" "four@" "five@">>
> > your score is Error in macro <<wikiCalc>>
> > presumably because the field values are true/false, not 1/0
>
> actually.. that's an incorrect presumption!
>
> If you click on the error, you will see:
>    "missing ) in parenthetical"
>
> The reason is because.... the %n substitution markers start with
> *0*... not *1*.  However, in your expression above, you started with
> %0 rather than %1.  As a consequence, the parameter value for "one@"
> is not inserted into the expression, and the final %5 has no value and
> is simply stripped away.  The result the final parenthetical term is
> "(*1)", rather than a properly formed "(true*1)" or "(false*1)" as
> intended.
>
> The good news is that if you simply 'shift' all the %n values in the
> format string, so that you start with %0, then you will see the
> results you expected, without any changes to the plugin needed!
>
> The even better news is that you don't need to do so much "forced
> typing" in the expression, because true==1 and false==0 in
> javascript.  Thus, you can replace the "(%n*1)" syntax with just "%n"
> and achieve the same result.
>
> your score is <<wikiCalc "%0+%1+%2+%3+%4" one@ two@ three@ four@
> five@>>
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to