Hi Tony,
I need to generate a (flat) list by using a recursive macro.
I found a somewhat bizarre solution:
------------
\define plotchain()
<$set name="chain" value="JJ/Das merkwürdige Tier">
$(chain)$
<<reku>>
</$set>
\end
\define chainer() [[$(chain)$]]
\define reku()
<$list filter="[list[$(chain)$!!thread]] [list[$(chain)$!!storylink]]"
variable="chain">
<$list filter="[<limiter>addprefix[x]!prefix[xxxxxxxxxxxx]]"
variable="limiter">
<<limiter>> <!--This is not necessary but shows that it works....-->
<<chain>>
<<reku>>
</$list>
</$list>
\end
<$vars chain="JJ/Das merkwürdige Tier" marker="y">
<<chainer>>
<<reku>>
</$vars>
--------------------------
I could not figure out another way to do so.
Strange but Yeahhh!
Jan
Am 17.10.2019 um 06:53 schrieb TonyM:
Jan,
Is this a flat list of tiddlers? Perhaps recursion is not needed.
If you had a seperate tiddler, lets call it path, and all tiddlers
involved would be tagged with path then <<tag path>> will allow you to
view and reorder the list. Your next and previous buttons could
iterate this list of path tagged tiddlers, identifying what next and
previous is and providing a button to move in either direction. The
value is you cannot add the same tiddler twice to this list of tagged
tiddlers thus you will never encounter a circle.
Tony
On Thursday, 17 October 2019 10:58:51 UTC+11, Jan wrote:
Hi Tony,
yes I need the details, I already thought of the toc-macro...but I
could not figure out how limiting recursions is done there.
I think this is the more promising approach.
Thanks! Jan
Am 17.10.2019 um 01:19 schrieb TonyM:
Jan
Here is a quick high level answer, let me know if you want more
details.
There are existing examples out there that avoid this like the
standard TOC however one method that comes to mind is as you
iterate each title add it to a variable "all members" (even a
data tiddler) and before doing so check it is not already named
in that variable. You can just change the action for it to do
nothing, the recursion will then move on with the next in line.
I have an algorithm (in a button) where I actually place the
"all members" variable into each tiddler as a field called
branch-branchname in your case this would be
thread-threadname thus each tiddler knows all its predecessors.
The thread name can be based on the first tiddler. This would
allow multiple threads to cross the same tiddlers without
interfering with the other thread. Since you know all the members
of the thread you could store the full thread in any tiddler.
Just some ideas
Tony
On Thursday, October 17, 2019 at 10:07:03 AM UTC+11, Jan wrote:
Hello,
want to show the title of a chain of tiddlers which mention
the next on in a field called thread.
This works fine like this
\define plotchain()
<$set name="chain" value="JJ/Das merkwürdige Tier">
$(chain)$
<<reku>>
</$set>
\end
\define chainer() [[$(chain)$]]
\define reku()
<$list filter="[list[$(chain)$!!thread]]
[list[$(chain)$!!storylink]]" variable="chain">
<<chainer>>
<<reku>>
</$list>
\end
<$vars chain="JJ/Das merkwürdige Tier">
<<chainer>>
<<reku>>
</$vars>
But if someone builds a cirle this crashes the wiki.
Is there a way of limiting recursions e.g. by using a filter
with math-operators?
Thanks!
Jan
--
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] <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/205a7345-aa5b-4b90-9757-9ad96929e146%40googlegroups.com
<https://groups.google.com/d/msgid/tiddlywiki/205a7345-aa5b-4b90-9757-9ad96929e146%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/473b4f62-70f6-4dd9-8638-12cc85b66873%40googlegroups.com
<https://groups.google.com/d/msgid/tiddlywiki/473b4f62-70f6-4dd9-8638-12cc85b66873%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/5DA820DE.1040001%40googlemail.com.