Check the Blank Macro parameter

65 views
Skip to first unread message

Mohammad

unread,
Feb 14, 2019, 4:08:23 AM2/14/19
to TiddlyWiki
Is the below method is good to check the blank NOT passed macro parameter (attribute)?


\define mm(newField:"Empty")
<$list filter="[<__newField__>] -Empty">
Do my job!
</$list>
\end

<$button>Check
<<mm test>>
</$button>


What is the appropriate solution? 
Keep it simple please!

--Mohammad

bimlas

unread,
Feb 14, 2019, 8:05:19 AM2/14/19
to TiddlyWiki
Since this does not work if the passed parameter is "Empty" exactly, this may also be a solution:

\define mm(newField)
<$list filter="[<__newField__>] -[[]]">

Mohammad

unread,
Feb 14, 2019, 11:33:43 AM2/14/19
to TiddlyWiki
Yep,
 Thanks Bimlas!
It works

--Mohammad

Mohammad

unread,
Feb 14, 2019, 11:49:52 AM2/14/19
to TiddlyWiki
Added to TW-Scripts.


On Thursday, February 14, 2019 at 4:35:19 PM UTC+3:30, bimlas wrote:
Reply all
Reply to author
Forward
0 new messages