Some time ago I made a special macro for exactly this, maybe you want to use it or at least profit from my experiments:
https://tid.li/tw5/hacks.html#ifAisB%20%E2%80%93%20Compare%20if-then-else%20Style%20in%20Wikitext
Happy comparing!
Thomas
<$vars foo="bar"><$list filter="[title<foo>] -[[bar]]" emptyMessage="foo EQUALS bar"> foo does NOT EQUAL bar</$list></$vars>
Thank you guys! As noted, the need is for it to be used inside a filter
\define compare(foo,bar)
<$list filter="[title[$foo$]regexp[^$bar$$]]" emptyMessage="no match">
Matches!
</$list>
\end
<<compare "stuff" "stuff">>
<$vars foo="stuff" bar="stuff">
<$list filter="[title<foo>field:title<bar>]" >
Matches!
</$list>
</$vars>
<$vars foo="stuff" bar="stuff">
<$list filter="[<foo>equals<bar>]">
THEY MATCH!
</$list>
<$list filter="[<foo>!equals<bar>]">
THEY DON'T MATCH!
</$list>
</$vars>
@Stephan, do you suggest it would be better to use the reveal widget?
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/my9YIZEPGng/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@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/c09b42b0-61d2-40d0-8921-fde3e314bfed%40googlegroups.com.
In my tests for the macro linked above I compared the reveal-way (it was suitable for my case). I decided to not use reveal because of the limitation of the reveal widget: You can’t use variables for both sides of the comparison.
<$reveal text=<<var1>> type="match" default=<<var2>> >
<<var1>> equals <<var2>>
</$reveal>
--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/my9YIZEPGng/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@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/efd34bcc-07d7-4fc5-b11c-1633d4b691d4%40googlegroups.com.
<$reveal state="mytiddler!!myfield" type="match" text="foo" > value is foo </$reveal>
<$reveal state="mytiddler!!myfield" type="nomatch" text="foo" default="foo"> value is not foo </$reveal>