Accessing a dictionary entry from a list

78 views
Skip to first unread message

Stephen Kimmel

unread,
Mar 7, 2018, 12:53:31 PM3/7/18
to TiddlyWiki
Per my usual, I'm fairly certain that this is easy... I just can't figure it out.

I have a lot of tiddlers named with the stock symbol. The tiddler for Ford is named F, for example. while the tiddler for Disney is named DIS. I want to create a data/dictionary tiddler called pricetiddler that will have the stock marker tickers symbols and the prices. So the data tiddler might look like :

APPL:175.07

DIS:103.13

F:10.51

MSFT:92.87

I want this in a dictionary tiddler so I can change all the numbers in one shot rather than changing a field in each of the tiddlers individually. Finally I want to create lists using something like

 <$list filter="[tag[computer]sort[title]]" variable="stock">
<<stock>> price = ${{pricetiddler##<<stock>>}}

</$list>

and create a list like:

APPL price = $175.07
MSFT price = $92.87

So far, no combination of symbols has given me what I want. Can someone tell me what I'm missing?

Mark S.

unread,
Mar 7, 2018, 3:20:42 PM3/7/18
to TiddlyWiki
Whenever you want to concatenate something, like the result of a variable and a tiddler name, think of macros -- that's mainly what they do. This script seems to work:

\define price() {{pricetiddler##$(stock)$}}
<$list filter="[tag[computer]sort[title]]" variable="stock">
<<stock>> price = $<<price>>

</$list>

HTH
-- Mark

Stephen Kimmel

unread,
Mar 8, 2018, 8:05:18 AM3/8/18
to TiddlyWiki
Many thanks.

Sure enough that's what I needed and as I expected it was simple enough. The $(name)$ was the combination I hadn't tried. Perhaps it isn't the best documented aspect of Tiddlywiki.

Again, thanks.

Stephen
Reply all
Reply to author
Forward
0 new messages