Hi Tobias Much nicer syntax -- declare all your variables first -- then use them in your calculations \o/
regards On Sunday, 20 December 2015 12:30:43 UTC+2, Tobias Beer wrote: > > Went jogging this morning and came back with another nice idea. > > Now, as of version 0.5.7 > <https://github.com/tobibeer/tw5-setvars/releases/tag/0.5.7> of > tobibeer/setvars <http://tobibeer.github.io/tw5-plugins/#setvars>, > you can refer to variables previously declared in the same setvars widget > instance. > > Get the update from the usual place: > > http://tobibeer.github.io/tw5-plugins/#setvars > > Here's a macro that shows how that works: > > *This macro routes a link to tiddlywiki.com <http://tiddlywiki.com> should > there not be a local tiddler by that name while also allowing you to use a > pretty title:* > > > \define route(title,pretty) > <$setvars > _exists="[[$title$]is[tiddler]]" > _not="[[$title$]!is[tiddler]]" > title="if( \$pretty$\ ? \$pretty$\ ) || \$title$\" > link=" > if( [exists] ? \[[\title\|$title$]]\ ) || > if( [not] ? \[ext[\title\|http://tiddlywiki.com#$title$]]\ )"> > <<link>> > </$setvars> > \end > > > *Note: *Notice how the link variable refers to the title variable > declared before it! > > <<route TextReferences "text-reference">> > > text-reference <http://tiddlywiki.com/#TextReferences> > > Best wishes, > > Tobias. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/2c090a35-fe09-4dac-88e7-d4852e21b004%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

