Hi Tony!
This is great and needs some examples to explore the pros and cons!
By the way as you said the application may vary case by case and a macro
may not be a good option.
--Mohammad
On Saturday, July 27, 2019 at 4:18:31 AM UTC+4:30, TonyM wrote:
>
> 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">>
> note: 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/52a0edc2-46f7-4ee4-850b-e810ba5008c1%40googlegroups.com.