--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d760d472-00cd-4eb8-8bd0-a01899613a40n%40googlegroups.com.
Below are three different ways to do this using reduce and without wikify. The last one uses a custom filter printf[] that is attached.
Note that you can use a tiddler for your template as well....
@TT what form would such a macro take? Just to display combined text, or save it somewhere? And in what format/structure?
If the majority of requests have a lot in common then it is easier to create a generic solution. Otherwise it might be better to try to raise awareness of the underlying techniques.I am increasingly using search-replace[] and my printf[] filter operators for string concatenation.
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/dd5d5a24-44ab-4c7a-8934-fc2cc1a79771n%40googlegroups.com.
Thank you Saq for the solutions!! Helps a lot : )
@Mohammed, I did try a search in the TW-scripts. So I think I will add a pull request to include Saq's solutions soon!
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d6e97852-c71c-4298-8654-616c0d441898n%40googlegroups.com.
Just in the interest of thoroughness, option 3 from my post above can be further simplified to:<$button> save to a single tiddler<$vars template="$(accumulator)$!! $0$$1$"><$action-setfield $tiddler="report" text={{{ [tag[About]] :reduce[<template>printf{!!title},{!!text}] }}}/></$vars></$button>However, the previous form makes it easier to understand how reduce is being used if one is not used to it.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8793816d-56b4-456e-b2f8-d75faa837fccn%40googlegroups.com.
So with the printf[] operator I attached which is not a part of the TW core, $(varname)$ is replaced by a variable called varname if it exists, just like in macros.So in the example above $(accumulator)$ is replaced with the value of the variable accumulator$n$ is replaced by the nth operand, zero based. So $0$ is replaced by the first operand, $1$ by the second operand.This again takes inspiration from macros and how macro parameters are replaced, but instead of using the name of a parameter we use the position of the operand.printf can handle an unlimited and flexible number of operands.This might not be something everyone would find intuitive, however it has been very useful for me in my own wikis.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e5cbe63a-59c4-44c8-81e9-322d6b6d0878n%40googlegroups.com.