Hi again Måns, 

Now this time we are going to solve thad riddle!

Try this and I try to explain gor your brain ;–)

---

\define he-she-it(gendervalue:"_false_") 
<$vars value="""$gendervalue$"""> 
<$set name="result" filter="[<value>!prefix[_false_]]" value=<<out>> 
emptyValue="it">

result: <<result>> 

</$set> 
</$vars>

\end 

<$checkbox field="gender" checked="he" unchecked="she"> male</$checkbox>

output: <$macrocall $name="he-she-it" gendervalue={{!!gender}}/>

---

It all starts with the macrocall instead of the shorter <<macroname param>> 
syntax. Frankly, I don’t know why. 
If the input for the macro is empty, we assign the value "_false_" (maybe this 
works only with the macrocall syntax). 
We assign the input value to a variable so we can use it in the filter later. 
The result is the output of a filter: if the input value does not (!) equal 
"false" we assign the input value. Else the filter returns empty and we assign 
"it". (You can of course change that to "gender unknown" if you like.)

Finally we generate the output starting with "result: …"

Hope that helps. More to come …

Cheers,
Thomas 

-- 
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/64222191-62c9-4733-b277-386f91615160%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to