Added to TW-Scripts On Friday, August 9, 2019 at 1:16:47 PM UTC+4:30, Jeremy Ruston wrote: > > Hi Mohammad > > Your conclusions are correct: macro parameters referenced as variables are > inherited like any other variables. > > To show what happens behind the scenes, a macro like this: > > \define mymacro(a,b) > <$text text=<<__a__>>/>: <$text text=<<__b__>>/>. > \end > > Would be equivalent to the following version that explicitly assigns to > the variables: > > \define mymacro(a,b) > <$set name="__a__" value="""$a$"""> > <$set name="__b__" value="""$b$"""> > <$text text=<<__a__>>/>: <$text text=<<__b__>>/>. > </$set> > </$set> > \end > > Best wishes > > Jeremy > > > On 9 Aug 2019, at 09:29, Mohammad <[email protected] <javascript:>> > wrote: > > In https://tiddlywiki.com/ <https://tiddlywiki.com/prerelease/> > > - create a new tiddler > - and copy paste the below script > - save and see the output > > > *Code* > \define One(p1, p2) > ;Inside One > :This is p1 in One: <$text text=<<__p1__>> /> > :This is p2 in One: <$text text=<<__p2__>> /> > > !!Call Two without passing p1, p2 > > <<Two p3:300>> > \end > > \define Two(p3) > ;Inside Two > :This is p1 in Two: <$text text=<<__p1__>> /> > :This is p2 in Two: <$text text=<<__p2__>> /> > \end > > <<One p1:100 p2:200>> > > > Output > > > Inside OneThis is p1 in One: 100This is p2 in One: 200Call Two without > passing p1, p2Inside TwoThis is p1 in Two: 100This is p2 in Two: 200 > > > That means scope of macro parameters span to all macro called from the > main macro! > > Is this correct? Is it practice to acces macro parameters in this way from > other calling macros? > > --Mohammad > > -- > 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] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tiddlywiki/dd722b10-dd34-477c-ab28-a7af336ac9f7%40googlegroups.com > > <https://groups.google.com/d/msgid/tiddlywiki/dd722b10-dd34-477c-ab28-a7af336ac9f7%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > >
-- 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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/bfdf2668-6a00-4dcd-b3fa-d17afdf6f2c0%40googlegroups.com.

