fET question (&& or OR or??)

29 views
Skip to first unread message

Måns

unread,
Apr 1, 2009, 7:14:46 PM4/1/09
to TiddlyWiki
Hi
Can I do something like this?:
<<forEachTiddler where 'tiddler.tags.contains("A") && tiddler.data
("x") *OR* tiddler.data("y") '

YS Måns Mårtensson

Eric Shulman

unread,
Apr 1, 2009, 7:36:30 PM4/1/09
to TiddlyWiki
> <<forEachTiddler where 'tiddler.tags.contains("A") && tiddler.data
> ("x") *OR* tiddler.data("y") '

The various clauses of fET are just bits of javascript, so you can use
the standard boolean operators:

AND = &&
OR = ||
NOT = !
with parentheses to control the order of evaluation.

Thus:
<<... where 'testA && (testB || testC)'... >>
means "A and B ... or ... A and C"
while:
<<... where 'testA && testB || testC'... >>
means "A and B ... or ... C"

enjoy,
-e

Måns

unread,
Apr 1, 2009, 7:54:54 PM4/1/09
to TiddlyWiki
Thanks . Just what I needed to keep on working :-)

SY MånsMårtensson

Måns

unread,
Apr 2, 2009, 9:30:01 AM4/2/09
to TiddlyWiki
Btw - if someone would like to se the looongest errorcode ever to
occur in a TW - then try to write
<<... where 'testA && (testB || testC)'... >> without the brackets!!
like this: <<... where 'testA && testB || testC'... >>
Astonishing how many words can be crammed into just one tiddler ;-)

YS Måns Mårtensson
Reply all
Reply to author
Forward
0 new messages