How to use a MacroParameter in an included second Marco?

33 views
Skip to first unread message

Jan

unread,
Jun 19, 2018, 6:20:49 PM6/19/18
to TiddlyWiki
Hi!

How do I get this to work?

\define firstlevel(param1:"the parameter")
<<secondlevel>>
\end

\define secondlevel()
And here I need $param1$
\end

<<firstlevel "you">>

Thanks!
Jan

Mark S.

unread,
Jun 19, 2018, 7:04:48 PM6/19/18
to TiddlyWiki
Well, this works, though it may not be what you have in mind:

\define firstlevel(param1:"the parameter")
<<secondlevel "$param1$">>
\end

\define secondlevel(param1:"the other parameter)

And here I need $param1$
\end

<<firstlevel "
you">>

You could also package the first parameter as a variable:

\define firstlevel(param1:"the parameter")
<$vars myvar="$param1$">
<<secondlevel>>
</$vars>
\end

\define secondlevel()
And here I need $(myvar)$
\end

<<firstlevel "you">>

Notice that when you use a parameter passed as a parameter you use $parameter$ but when you use a variable (I'm sure I'm using the terminology)  then you use $(variable)$. Both forms, $param$ and $(variable)$ are only good when called INSIDE a macro.

HTH
-- Mark

Jan

unread,
Jun 19, 2018, 9:56:30 PM6/19/18
to tiddl...@googlegroups.com
Hello Mark, thanks a lot,
the second solution works, in my constellation the first one somehow did not....


Yours Jan
--
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+...@googlegroups.com.
To post to this group, send email to tiddl...@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/52ee0126-988e-45fe-9a72-fd07bad65a5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages