Part 2: Assigning other values by calling a macro via a variable. 

Code: 

---

\define He-She-check(gendervalue:"_false_") 
<$vars value="""$gendervalue$"""> 
<$set name="result" filter="[<value>!prefix[_false_]]" value="He-She" 
emptyValue="no-value">

<$macrocall $name=<<result>> gendervalue=$gendervalue$ />

</$set> 
</$vars>
\end 

\define He-She(gendervalue) 
<$vars value="""$gendervalue$"""> 
<$set name="result" filter="[<value>prefix[he]]" value="He" emptyValue="She">

result: <<result>> 

</$set> 
</$vars>
\end 

\define no-value(gendervalue) 

gender is not defined 

\end 

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

output: <$macrocall $name="He-She-check" gendervalue={{!!gender}}/>

---

In the check-macro we test, if the value is not empty in the same way as 
before. 
According to the test result we assign the name of the next macro we want to 
call. 
If we have a value, we go to the He-She macro and check, if the value is "he". 
Then we generate a maching output "He" or "She". 

O.k. for your brain? 

All the best!
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/d28ba3a6-2a56-4ddc-b2b1-60a0c6040d46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to