Mohammad,
> We need to wrap inside a macro to present a construct like
>
> <<select-case condition array-of-cases>>
>
>>
>>
>
In someways I am suggesting you do not need to make a "select-case macro "
because the whole case structure including the empty case can be written
inside the one outer list object. Thus it may be included something like
this
{{invoice-total}}
where the case test various conditions and generates a result eg if tax
applies etc...
However if you do want to make a macro as in your example the case
structure will still need to know how to handle your array-of-cases
I would think its more like this;
\define if-else-test(filter)
<$list filter="[[$filter$]] ~[[::else]]" variable=case>
<$list filter="[<case>!prefix[::else]]" variable=case>
filter-not-empty do-this for each result
</$list>
<$list filter="[<case>prefix[::else]]" variable=case>
else do-that
</$list>
<!-- other cases if desired -->
</$list>
\end
<<if-else-test "filter">>
not: untested
Regards
Tony
--
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/1cf05827-3ae6-4171-a9f2-db625af4d052%40googlegroups.com.