Hi Brad
> Pretty basic question, I believe... I have been trying to get some plugin
> macros to work, and the output is NaN, which I am guessing means "not a
> number".
>
> The plugin macros work if a number is put in the macro call, but when I try
> to transclude a field it gives NaN. The macro is supposed to output the raw
> score and a bonus based on the raw score. It's a Dungeons & Dragons thing if
> you aren't familiar.
>
> <<dnd.ability 16>> Gives correct output: 16 (+3)
>
> <<dnd.ability {{!!dnd.creature.str}}>> Gives: NaN <x-msg://6/#NaN>
> (−NaN <x-msg://6/#NaN>)
>
> {{!!dnd.creature.str}} Correctly transcludes the field value: 16
>
> Is there the something line an INT function that must be used to say this is
> an integer and not a string?
The macro call <<dnd.ability {{!!dnd.creature.str}}>> passes the literal string
"{{!!dnd.creature.str}}” as the parameter to the macro, rather than evaluating
it.
There’s a more flexible underlying syntax for calling macros where the
parameters are evaluated before invocation:
<$macrocall $name="dnd.ability" paramName={{!!dnd.creature.str}}/>
Where “paramName” is the name of the parameter to your macro.
> Also, I was simply pasting in some of the mathematics operator examples and
> they do not evaluate the expression. There is obviously something else I am
> missing:
>
> [[23]add[19]] gives 23]add[19 <x-msg://6/#23%5Dadd%5B19>
Pasting [[23]add[19]] is interpreted as a link to a tiddler titled “23]add[19”
because filter expressions are only evaluated in certain contexts, notably
triple curly braces. Try:
{{{ [[23]add[19]] }}}
Best wishes
Jeremy
>
> Thanks!
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/5329b09b-2498-450f-b980-a31a8d7403a7n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/tiddlywiki/5329b09b-2498-450f-b980-a31a8d7403a7n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/AF8C2674-4596-4E09-B516-0172A8707836%40gmail.com.