This would be worth a simple summary, to guide users. Since I am not so sure about your question, I suspect you just had a "mind block".
- if you want to use parameters in a macro they need to be named in the braces macroname(p1 p3) the access them with $p1$ $p2$
- You can set a default value for parameters with (p1:"defaultvalue",p2)
- When calling the macro the `<<macroname>>` is a little limited, only literal strings can be used ` <<macroname "value1" "Value2">>`
- Here we are relying on the order of the parameters
- If you want to pass parameters out of order you need to name them, for example we may want to use the default for p1 and pass only value2
- We use `<<macroname p2:"value2">>` uses the same format as inside the definition braces ().
- The only way to pass variables and field values to a macro is the macrocall widget
- `<$macrocall $name="macroname" p1={{!!fieldname)) p2=<<variable>> p3=<<wikifiedmacro>>/>`
- However variables in the calling wikitext can be accessed in macros with $(varname)$ without being added to the parameters
- Whenever something is wrapped in $ signs the value is replaced before the wikitext/macro is evaluated., ro $values$ or $(varname)$ may need to be quotes etc..
- `<$tiddler tiddler="[[($currentTiddler$)]]">...` (only in macro definitions)
- There may be cases where you want to use one of the parameters as if it were a variable
- `<$tiddler tiddler=<<__p2__>> >...`
Other ways to set default value for parameters
\define macroname(p1 p2)
<$set name=p1 value="$p1$"emptyValue="defaultValue">
Use <<p1>> not $p1$
</$set>
\end
See how this converts the parameter to a variable?
The default value can be other references or macros as well.
You can even set the `p1` variable multiple times
<$set name=p1 value="$p1$"emptyValue="$(varname)$">
<$set name=p1 value=<<p1>>"emptyValue="defaultValue">
Use <<p1>> not $p1$
</$set></$set>
In this case if no parameter is provided, and the first emptyValue=
"$(varname)$" is itself emptyThen the defaultvalue will be set
Regards
TW Tones