Question:
 How does it possible to have a conditional operation in TW

   - *Question*

Assume based on the value of input to a macro parameter I want to do some 
operation like

IF CONDITION THEN
   TRUE-PART
ELSE
   FALSE-PART
END IF


   - *My solution: Is it correct?*


I did something like this

\define _maca(x) This is Macro ''A'':  $x$
\define _macb(y) This is Macro ''B'':  $y$

\define polymorph(input, cond:"a")
 <$reveal type="match" text=$cond$ default="a")>
    <<_maca $input$>>
 </$reveal>
 <$reveal type="match" text=$cond$ default="b")>
    <<_macb $input$>>
 </$reveal>
\end




   - Example

<<polymorph "Hi">>
<<polymorph input:"Hello">>
<<polymorph input:"Hola" "b">>
<<polymorph input:"Hola" cond:"b">>



   - Output

This is Macro *A*: Hi

This is Macro *A*: Hello

This is Macro *B*: Hola

This is Macro *B*: Hola



Is this correct? If I want to have something like below, what can I do

IF CONDITION THEN
   TRUE-PART
ELSE IF
   OTHER-PART
ELSE
   FALSE-PART  
END IF


-- 
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/0f614628-d937-458d-bf39-55c9ac615ceb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to