This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Ex:MacroCallAsParameter/answer

9th April 2021 at 2:52pm

\define wikipediaLink(articleName, linkText)
[[$linkText$|https://en.wikipedia.org/wiki/$articleName$]]
\end

\define animalLinkText(initialLetter)
An animal which begins with $initialLetter$
\end

* <$macrocall $name="wikipediaLink" linkText=<<animalLinkText A>> articleName="Aardvark" />
* <$macrocall $name="wikipediaLink" linkText=<<animalLinkText B>> articleName="Bee" />
* <$macrocall $name="wikipediaLink" linkText=<<animalLinkText C>> articleName="Cow" />

Your choice of parameter name (initialLetter in my version) makes no functional difference as long as you use the same name in the parameter list and in the body of the macro. But it's best to name the parameter in a way that carefully describes what you expect it to contain – don't call it something or x, for example – to make life easier on yourself in the future if you have to reread your macro.

Go to question: Ex:MacroCallAsParameter