Hi Mat, I will elaborate on that and modify to have switch(item, list) One simple case is like below:
\define switch(item, list:"a b c") <$list filter="[enlist<__list__>search<__item__>]" emptyMessage="Default"> You passed <<currentTiddler>> </$list> \end <<switch a>> <<switch b>> A more sophisticated cab be lie this \define a() This is the action for a. \define b() This is action for b. \define c() This is action for c. \define default() This is default action. \define switch(item, list:"a b c") <$list filter="[enlist<__list__>search<__item__>]" emptyMessage=<<default>> variable="actMacro"> <$macrocall $name=<<actMacro>> /> </$list> \end <<switch a>> <<switch b>> <<switch d>> When in a tiddler the switch is called in that tiddler the action macro can be defined! The code required the same action macro name as item name. --Mohammad On Thursday, July 4, 2019 at 5:46:47 PM UTC+4:30, Mat wrote: > > Mohammad - very cool and should be really useful to have it as a defined > pattern. > > It could be made more general if "switch(item, list)" > > <:-) > -- 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a81b420e-e4ae-44e0-acab-fbd952297959%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

