Arlen, I developed two examples based on your smart filter \define gt(a, b) $a$ $b$ +[nsort[]last[1]remove[$b$]] \define lt(a, b) $a$ $b$ +[nsort[]first[1]remove[$b$]]
\define exmp-gt() <$list filter=<<gt $(x)$ 5>> variable="result"> <<result>> </$list> \end \define exmp-lt() <$list filter=<<lt $(x)$ 5>> variable="result"> <<result>> </$list> \end Demo <$list filter="2 8 5 7 6 3 9" variable="x"> <<exmp-gt>> </$list> <$list filter="2 8 5 7 6 3 9" variable="x"> <<exmp-lt>> </$list> On Tuesday, March 12, 2019 at 12:41:06 PM UTC+3:30, Arlen Beiler wrote: > > I just discovered something that I think is undocumented but could be > extremely useful! When arguments are passed to the macrocall widget, it > first processes the param substitutions of the macro, AND THEN processes > the variable substitutions. This means that you can pass in a variable > substitution as a paramater, like this: > > \define gt(a, b) $a$ $b$ +[nsort[]last[]remove[$b$]] > <$list filter=<<gt "$(window-width)$" "512">> variable="temp"> > > </$list> > > In case you're curious about the filter, it sorts the two arguments and if > the second one is larger the list will not output a DOM element. > > Enjoy! > Arlen > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. 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/cc655787-da59-42e7-9ea1-df0b67d278d4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.