On Monday, June 29, 2020 at 10:34:01 PM UTC-7, Dave Parker wrote:
>
> \define vassum2(here myfield)
> <$text text={{{=[title[$here$.VAShi]get[$myfield$]]
> =[title[$here$.VASlo]get[$myfield$]]
> =[title[$here$.disAbil]get[$myfield$]] +[sum[]]}}}/>
> \end
>
> \define vassum()
> <$list
> filter="[all[current]addsuffix[.VAShi]fields[]regexp[\d\d\d\d-\d\d-\d\d]]"
> variable="field">
> <$macrocall $name=vassum2 here="$(currentTiddler)$" myfield=$field$ />
> *<-- here?
> </$list>
> \end
> <<vassum>>
>
>
Inside the
<$list ... variable="field">...</$list>
you would use
<<field>>
to see the current value of the variable.
Also note that in your
<$macrocall ... myfield=$field$ />
there is NO ***macro parameter*** named "field", so $field$ is always blank.
I think perhaps you mean to write
<$macrocall ... myfield=<<field>> />
which would pass the current value of the "field" ***variable*** into the
vassum2() macro.
I'm also thinking that you could skip the macros and just write this:
<$list
filter="[<currentTiddler>addsuffix[.VAShi]fields[]regexp[\d\d\d\d-\d\d-\d\d]]"
variable="field">
<$text text={{{ =[<currentTiddler>addsuffix[.VAShi]get<field>] =[
<currentTiddler>addsuffix[.VASlo]get<field>] =[<currentTiddler>
addsuffix[.disAbil]get<field>] +[sum[]] }}}/>
</$vars>
First, use $list to extract the matching fieldnames from "...VAShi" (I
assume your fieldnames are probably dates like "2020-06-30")
Then, for each matching fieldname, get the value of that field from the
"...VAShi", "...VASlo", and "...disAbil" tiddlers and show the sum of the
three values
-e
--
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/baed6174-8e1a-4353-b420-5767bfdc8b68o%40googlegroups.com.