Another related approach may be something discussed in recent weeks

The content of the <$view> widget is displayed if the field or property is 
missing or empty.

So you can go ahead and display a value if its present, otherwise the 
content of the view widget can be used to handle its 
creation. https://github.com/Jermolene/TiddlyWiki5/issues/3789

Regards
Tony

Presently the view widget only accepts tiddler and fieldnames but I am 
asking it also accept variables. 

On Sunday, March 31, 2019 at 7:59:14 AM UTC+11, S. S. wrote:
>
>
> I found a solution here: [TW5] Using conditional assignment mode of 
> SetWidget to check empty strings 
> <https://groups.google.com/forum/?hl=en#!searchin/tiddlywiki/macro$20empty$20parameter$20$20%7Csort:date/tiddlywiki/Pzv5FDb9oHE/wmgNZwtWAgAJ>
>
> Either of the below work, and I chose the former.
> filter="[enlist[$tiddler$]]"
>  filter=" $tiddler$"
>
> Regards
>
>
> On Saturday, March 30, 2019 at 11:17:57 PM UTC+7, S. S. wrote:
>>
>> Within a macro, I am trying to determine if a parameter is empty, and 
>> then set a variable based on knowing that it is empty.
>>
>> I came across the Google Group post from a last month: Check the Blank 
>> Macro parameter 
>> <https://groups.google.com/forum/?hl=en#!topic/tiddlywiki/82N15sAnoPs/discussion>
>> \define mm(newField)
>> <$list filter="[<__newField__>] -[[]]">
>>
>> Do my job!
>> </$list>
>> \end
>>
>>
>> <<mm test>>
>>
>> So I tried using something based on that. Pasting the below into a new 
>> tiddler on tiddlywiki.com shows the issue:
>>
>> \define test(tiddler)
>> <$set name="result" filter="[[$tiddler$]] -[[]]" value="Why is this 
>> variable set when the filter ''is not missing'' and ''it's empty''?">
>>
>> The description of the ''value'' attribute of the `$set` widget says: The 
>> value to assign to the variable if the filter is missing or ''//not 
>> empty//''
>>
>> tiddler=$tiddler$  
>>
>> result=<<result>>
>>
>> <$list filter="[[$tiddler$]] -[[]]" emptyMessage="See, the filter shows 
>> it's Empty">
>> </$list>
>> </$set>
>> \end
>>
>> <<test>>
>>
>>
>> I don't understand where I've gone wrong. I'd appreciate some advice.
>> Thanks.
>>
>>
>>

-- 
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/49f044a2-b1f3-493f-baf2-a20b8070a0e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to