Thank you Jed for the specific examples. I knew how to substitute but 
wasn't aware of the 'inverse' syntax for the <$count> operation -- when 
noted as the <$count> widget I could never get it to work but putting it at 
the end of a <$list> filter as [count] does work exactly as needed.

Just for the record, here's my sample code -- by means of an example, this 
code returns a sum of tiddlers tagged as apples and oranges (so, 2 
variables wrapped around the macro that's performing the calculation). The 
'oranges' list still returns the full count as defined by its own filter, 
even though it's encapsulated within the 'apples' list filter. I guess 
that's because it's a count operation.

\define Calculation()
<<formula "$(apples)$+$(oranges)$">>
\end

<$list filter='[tag[apple]count[]]' variable='apples'>
<$list filter='[tag[orange]count[]]' variable='oranges'>
<<Calculation>>
</$list>
</$list>

Thanks again!

Best regards,
Hubert





On Friday, 30 March 2018 19:38:45 UTC+1, Jed Carty wrote:
>
> Wow, I missed a lot of new things. I wasn't aware of the count operator. 
> To give some examples of what Mat is talking about here is how you would 
> use it to get an input to a macro (copy and paste this into a tiddler on 
> tiddlywiki.com to see what the two methods do):
>
> \define DoSomething()
> The filter counted $(number)$ tiddlers
> \end
>
> \define DoSomethingElse(number)
> The filter counted $number$ tiddlers
> \end
>
> !!Method 1 - Substitution
>
> <$list filter='[tag[HelloThere]count[]]' variable='number'>
> <<DoSomething>>
> </$list>
>
> !!Method 2 - Macrocall widget
>
> <$list filter='[tag[HelloThere]count[]]' variable='number'>
> <$macrocall $name=DoSomethingElse number=<<number>>/>
> </$list>
>
>
> As Matthew Lauber said, you can also use a set widget to make the 
> variables, I just like the list widgets for some reason.
>

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8764af3b-88b4-4d37-aa60-8b1939b7f119%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to