\define tobilogic(parameter) <$list filter="[[$(variable)$]]"><$view field="title">$parameter$</$view></$list>
!variable not defined
<<tobilogic "Okay! variable not defined">>
!variable defined
<$set name="variable" value="OK! variable defined">
<<tobilogic "Wrong! variable not defined">>
</$set>
\define otherlogic(parameter) <$list filter="[[$parameter$]]"><$view field="title">$(variable)$</$view></$list>
<$set name="variable" value="Variable used">
!No Parameter
<<otherlogic>>
!With Parameter
<<otherlogic "Okay! Parameter found">>
</$set>
\define macro(foo)
<$if $foo$>
do this
<$else>
<$if <<foo>>>
do that
<$else>
otherwise this
</$else>
</$if>
</$else>
</$if>
\end
\define macro(foo)
<$if match="$foo$" value="bar">
do this
<$else>
<$if match="$foo$" value="baz">
do that
<$else>
otherwise this
</$else>
</$if>
</$else>
</$if>
\end
To get a real if/else sort of widget that fits with the current wikitext syntax I think you would need something like:\define macro(foo)
<!-- if $foo$ ; begin --><$reveal type="nomatch" state=" non existing tiddlre " text="$foo$">
do this
<!-- end --></$reveal>
<!-- else ; begin --><$reveal type="match" state=" non existing tiddlre " text="$foo$">
<!-- if <<foo>> ; begin --><$reveal type="nomatch" state=" non existing tiddlre " text="$(foo)$">
do that
<!-- end --></$reveal>
<!-- else ; begin --><$reveal type="match" state=" non existing tiddlre " text="$(foo)$">
otherwise this
<!-- end --></$reveal>
<!-- end --></$reveal>
\end
! No Param, No Var
<<macro>>
! Param, No Var
<<macro "foo param">>
<$set name="foo" value="foo var">
! No Param, Var
<<macro>>
! Param, Var
<<macro "foo param">>
--
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 http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.
The simplest proposal is for new \ifdef and \ifndef pragmas...
\ifdef param
\if param (mode:value)\if param (equals:<<foo>)\if param (equals:<<foo>)
\if param (equals:<<foo>>)Instead, we could do things like...\if param (mode:value)for example...\if param (equals:<<foo>)
Best wishes, Tobias.