$set experiments - some Q's and maybe even a bug?

35 views
Skip to first unread message

Mat

unread,
Apr 1, 2016, 6:02:44 AM4/1/16
to TiddlyWikiDev
A bit too intricate to post on the general board:

<$set name="A" filter="aaa [[bbb ccc]] ddd">

#<$set name="B" value=<
<A>>  ><<B>></$set> -
#<$set name="B" filter=<
<A>>    ><<B>></$set> - quotemarks not always needed in filters?
#<$set name="B" filter="<
<A>>" ><<B>></$set>
#<$set name="B" filter="
<A>"     ><<B>></$set> - then why does the initial setting of A work?
#<$set name="B" filter="[
<A>]"   ><<B>></$set> - bug?
</$set>

yields
  1. aaa bbb ccc ddd -
  2. aaa bbb ccc ddd - quotemarks not always needed in filters?
  3. aaa bbb ccc ddd
  4. - then why does the initial setting of A work?
  5. aaa [[bbb ccc ddd]] - bug?
Note that the blue in #5 is one single link.

If anyone would be kind to comment on my comments, I'd appreciate it.

Thanks

<:-)

Jeremy Ruston

unread,
Apr 1, 2016, 6:44:42 AM4/1/16
to TiddlyWikiDev
Hi Mat


<$set name="A" filter="aaa [[bbb ccc]] ddd">

#<$set name="B" value=<
<A>>  ><<B>></$set> -
#<$set name="B" filter=<
<A>>    ><<B>></$set> - quotemarks not always needed in filters?

In your second example the value of the variable "A" is used as the value of the "filter" attribute; so the effect is the same as if you had written:

filter="aaa [[bbb ccc]] ddd"
 
#<$set name="B" filter="<<A>>" ><<B>></$set>

#<$set name="B" filter="
<A>"     ><<B>></$set> - then why does the initial setting of A work?

I'm not sure what you're expecting to happen here; you're assigning the string "<A>" to the "filter" attribute.
 
#<$set name="B" filter="[<A>]"   ><<B>></$set> - bug?

Here you're passing the value of the variable "A" as the value of an item in the list you are creating in the filter. It's the workaround that one uses if one needs to put square brackets in a tiddler title in a filter.
 
Best wishes

Jeremy
Reply all
Reply to author
Forward
0 new messages