Arguments evaluated when called?

4 views
Skip to first unread message

Amzg

unread,
Aug 1, 2008, 9:46:57 PM8/1/08
to TiddlyWiki
Inside a script, a var (say P) is set to be a title of a random
tiddler.
I then wish an array (A) for all tiddlers containing some certain tags
and also whatever P happens to be.
How should I phrase this?

var A=store.filterTiddlers("[tag[Tag1 AND NOT Tag2]] AND P");

I.e the problem is at the end. Should P be within the [ ]? Maybe it
should be surrounded by e.g " " or { } to be evaluated? Should it say
'P.value' or something? ...

Thanks in advance!

/Mat

Amzg

unread,
Aug 4, 2008, 6:48:24 AM8/4/08
to TiddlyWiki
Maybe the previous was unclear? Sorry, here's hopefully a
simplification;

var Array=store.filterTiddlers("[tag[Tag1]]);
var B=storefilterTiddlers("[tag[Tag2 AND Array[0].title]]");

How should "A[0b].title" e phrased?

Thank you!

/Mat



FND

unread,
Aug 4, 2008, 6:52:34 AM8/4/08
to Tiddl...@googlegroups.com
> var Array=store.filterTiddlers("[tag[Tag1]]);
> var B=storefilterTiddlers("[tag[Tag2 AND Array[0].title]]");
> How should "A[0b].title" e phrased?

If it's just about JavaScript syntax on the second line, try this:
---------------
var arr = store.filterTiddlers("[tag[Tag1]]"); // avoiding Array keyword
var B = storefilterTiddlers("[tag[Tag2 AND " + arr[0].title + "]]");
---------------


-- F.

Amzg

unread,
Aug 4, 2008, 10:53:18 AM8/4/08
to TiddlyWiki
Thank you FND!!! Issue solved!

/Mat
Reply all
Reply to author
Forward
0 new messages