If you can call the filter as a macro, or call a macro to make the filter, 
then this works:

\define compare(foo,bar)
<$list filter="[title[$foo$]regexp[^$bar$$]]" emptyMessage="no match">
Matches! 
</$list>
\end

<<compare "stuff" "stuff">>

It needs to be set up as a macro so it can use regexp[^$bar$$] (or 
regexp[^$(bar)$$] if passed as an environmental variable.

What I don't understand, is why THIS doesn't work:

<$vars foo="stuff" bar="stuff">
<$list filter="[title<foo>field:title<bar>]" >
Matches!
</$list>
</$vars>

I've looked over the spec.s for the field operator. It should select an 
input title if an only it matches it's parameter. And the title operator 
should generate a tiddler title to be matched. But it doesn't seem to work 
that way. Instead, the field:title only returns the input title if the 
input title actually exists as a tiddler. But the spec's don't say that.

Good luck!
Mark



On Sunday, August 27, 2017 at 12:45:22 PM UTC-7, Mat wrote:
>
> I often want to test if e.g a field or variable has a certain value. How 
> do I best do this in a filter?
>
> [{foo!!bar}EQUALS[frotz]]
>
> ...what is "EQUALS" ?
>
> <:-)
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/185d7e6d-6f12-404d-a4db-ddcb5047faa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to