Added to TW-Scripts. On Friday, February 8, 2019 at 11:35:48 AM UTC+3:30, Eric Shulman wrote: > > On Thursday, February 7, 2019 at 10:42:49 PM UTC-8, Mohammad wrote: >> >> As we know a variable from ouside macro should be referenced as >> $(varname)$. >> > > A variable that is defined outside a macro can be referred to within the > macro using **either** $(varname)$ or <<varname>>, depending on context. > > The difference is that occurrences of $(varname)$ are immediately replaced > with the current value of the variable, while <<varname>> is simply > returned unchanged as part of the macro output. Thus these are all valid > uses: > > \define mymacro() <$somewidget param="$(currentTiddler)$" /> > \define mymacro() <$somewidget param="TEXTBEFORE $(currentTiddler)$ > TEXTAFTER" /> > \define mymacro() <$somewidget param=<<currentTiddler>> /> > > but the following is NOT (because it mixes <<...>> inside a quoted > parameter value where parsing doesn't occur) > \define mymacro() <$somewidget param="TEXTBEFORE <<currentTiddler>> > TEXTAFTER" /> > > -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 [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/e266e10a-05e2-4699-b6b2-b65e812b0bfc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

