On Thursday, July 13, 2017 at 1:19:14 PM UTC-7, stevesuny wrote:
>
> I thought that, too.
>
> The problem: <$set name="this-value" value=<<currentTiddler>>> names to 
> the current tiddler, not the value of the field that I am interested in.
>
> How do I set this-value to a field value, whose name is itself a variable?
>

This situation is referred to as "double indirection" (i.e. using one 
variable to hold the name of another variable that contains the desired 
value)

Try using a little "helper" function to construct the desired reference...

Something like this: (untested)
\define getFieldValue() {{!!$(this-field)$}}

<$list filter="[all[current]tag[element-field]]"
   <$vars this-field=<<currentTiddler>>>
   <$list filter="[tag[schedule-elements]each<this-field>sort<this-field>]">
      <$vars this-value=<<getFieldValue>>>
      <<this-field>>: <$link><<this-value>></$link><br>
      </$vars>
   </$list>
   </$vars>
</$list>

<<getFieldValue>> uses the $(...)$ syntax to substitute the current field 
name into the transclusion syntax.  Thus, if this-field has a value of 
"foobar", <<getFieldValue>> will return "{{!!foobar}}" which is then parsed 
by the <$vars> widget to retrieve the field value and assign it to the 
"this-value" variable

Note: instead of using the <$set name="foo" value="bar"> syntax, I prefer 
to use the <$vars foo="bar"> syntax.... they both will have the same 
result, but <$vars> seems easier to read.

enjoy,
-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/ef04de4c-31df-4ad8-b342-ec37088eeafd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to