The white space part of the setvars works fine.  Thanks for that tip,
should make it easier to add to later.

Out of curiosity, in what order are macros, text references, widgets, etc
used?  I ask because I'm extremely close to getting a tiddler that can
modify the large number of already-made character tiddlers to add a working
caption field.
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
This
email has been sent from a virus-free computer protected by Avast.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Sun, Jan 10, 2016 at 3:54 AM, Tobias Beer <beertob...@gmail.com> wrote:

> Hi David,
>
> I'm a quite amazed to find you using *setvars* at that level of
> complexity. *bows down*
> As for long expressions like yours, I'd possibly use plenty line-breaks
> and white-space for readability, e.g.:
>
> \define name_output(species,first,second,third)
> <$setvars
> twothreename="""
>   (\$third$\ ? \$third$, $first$ $second$\) ||
>   \$second$, $first$\
> """
> formatted_name="""
>   (\$species$\ == \Human\ ? twothreename ) ||
>   (\$species$\ == \Bajoran\ ? \$first$ $second$\) ||
>   (\$species$\ == \Garbrini\ ? \$second$, $first$ $third$\) ||
>   \$first$\
> """>
> <<formatted_name>>
> </$setvars>
> \end
>
> Can you test and confirm that the above works? I think it should.
>
> Here are the fields in an example character tiddler:
>>
>> caption: <<name_output Human John Brown Doe>>
>> species: Human
>>
>
> As for using wikitext in fields. Be mindful that transcluding and reusing
> that at other places, e.g. in macros may have unexpected results in that
> the field value is not wikified before using. So, you're actually passing
> the string <<name_output Human John Brown Doe>>.
>
> Therefore, I think what you need to do is:
>
> Instead of using wikitext (macros) in fields directly,
> have as many fields as are needed to create the proper output where you
> need it, elsewhere.
> In other words, you should have fields like *name-1st*, *name-2nd*,
> *name-3rd*
> and then have a macro *outside* of your field contents
> that does your desired handling where ever you need it,
> but not as the field value.
>
> Does that make sense?
>
> Best wishes,
>
> Tobias.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/NwaJdnB_yTU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> 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/73772a65-a91b-4112-8795-cfbaa90a0ac6%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/73772a65-a91b-4112-8795-cfbaa90a0ac6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
David Allen

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
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/CALaYjLjLUF6E0kpv1%3DM7QeiF%3D%3DiEwdV5ALPDCPrEGUA%3DA6XdCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to