Hi Hegart,
Thank you for your efforts!
I took a look at your demo. I like the trick of using one tiddler with
multiple fields for variables. Simple and elegant.

The calc plugin can be used to increment a value in a button (
http://tobibeer.github.io/tb5/#calc). This increments by the incrementer
value:

<$button set="$:/_Data/variables!!current-count" setTo=<<calc $:/_Data/
variables!!current-count + by:$:/_Data/variables!!incrementer>>>+</$button>

So that is now a part of the pseudocode:

<$edit-text tiddler="$:/_Data/variables" field="current-count" size="5" />
<$edit-text tiddler="$:/_Data/variables" field="incrementer" size="5" />
<$edit-text tiddler="$:/_Data/variables" field="filter" size=50 />

<$list filter={{$:/_Data/variables!!filter}}>

for each tiddler in list
    set field 'sort_order' to <<current-count>>
    increment <<current-count>> by <<incrementer>>
next tiddler

It's a question of triggering an action inside a list, in such a way as to
make it act like a "for" loop.

-Matthew

On Thu, 21 Apr 2016 at 00:30 Hegart Dmishiv <[email protected]>
wrote:

> Hi Matthew,
>
> Sorry, I was working on a solution to this yesterday, but I got
> sidetracked. Here's a demo
> <https://dl.dropboxusercontent.com/s/njl70ojvalhkri7/demo-make-incremental.html>
> I've been building. It's not complete yet, and the essential ingredient is
> still missing, so you might not even want to waste your time with it yet.
> I'll let you know if/when I solve it. In the meantime, if anyone else can
> come up with a solution, that'd be great.
>
> Hegart.
>
>
>
> On Thursday, 21 April 2016 01:40:18 UTC+12, Matthew Petty wrote:
>>
>> Bump? Anyone?
>> I have the feeling that setvars would be useful, or calc, or
>> action-setfield. But how to bring it together?
>>
>> On Tuesday, 19 April 2016 13:57:16 UTC+4, Matthew Petty wrote:
>>>
>>> Ah, no, apologies for the confusion. Here's what I want, in more
>>> detailed pseudocode (I'm probably using the wrong symbols):
>>>
>>> set index=1
>>> set increment_amount=1
>>> set filter="[tag[this_tag]nsort[sort_order]]"
>>>
>>> select list of tiddlers by <<filter>>
>>> for each tiddler in list
>>>     set field 'sort_order' to <<index>>
>>>     increment <<index>> by <<increment_amount>>
>>> next tiddler
>>>
>>>
>>> One issue that I can think of is that because the filter is using the
>>> field being changed, it may affect the list when it is changed.
>>>
>>> -MJP
>>>
>>> On Tuesday, 19 April 2016 13:16:26 UTC+4, Hegart Dmishiv wrote:
>>>>
>>>> Hi Matthew,
>>>>
>>>> Can I confirm, do you want the *name* of the field itself to be
>>>> incremented, or the *value* within a given field to be incremented?
>>>> From your examples above, it looks like you want the former, is that
>>>> correct?
>>>>
>>>> Hegart.
>>>>
>>>>
>>>> On Tuesday, 19 April 2016 21:01:33 UTC+12, Matthew Petty wrote:
>>>>>
>>>>> I've looked at that, but it seems to be creating new tiddlers, and
>>>>> setting the titles. What I need is to take existing tiddlers and set a
>>>>> field.
>>>>>
>>>>> On Tue, 19 Apr 2016 at 12:46 Hegart Dmishiv <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi Matthew,
>>>>>>
>>>>>> I think TobiBeer's *make[ ]* filter plugin
>>>>>> <https://tobibeer.github.io/tw5-plugins/#make> might be what you're
>>>>>> looking for.
>>>>>>
>>>>>> Hegart.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tuesday, 19 April 2016 20:09:34 UTC+12, Matthew Petty wrote:
>>>>>>>
>>>>>>> I've been looking at tobibeer's setvars plugin, to see if that would
>>>>>>> work, but I can't figure it out.
>>>>>>>
>>>>>>> Here's some pseudocode for what I want to do.
>>>>>>>
>>>>>>> set index to initial value
>>>>>>> set increment amount
>>>>>>> set required filter and sort
>>>>>>>
>>>>>>> select list of tiddlers by the filter
>>>>>>> for each tiddler
>>>>>>>     set field to index value
>>>>>>>     increment index by increment amount
>>>>>>> next tiddler
>>>>>>>
>>>>>>> Any help gratefully received
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Monday, 18 April 2016 23:30:49 UTC+4, Matthew Petty wrote:
>>>>>>>>
>>>>>>>> I have a set of tiddlers, and I want to set a field for each one,
>>>>>>>> incrementing the value each time.
>>>>>>>>
>>>>>>>> So for example, I have tiddlers A B C D, and after running this
>>>>>>>> macro or whatever, they would have the following fields:
>>>>>>>> A would have 1
>>>>>>>> B would have 2
>>>>>>>> C would have 3
>>>>>>>> D would have 4
>>>>>>>>
>>>>>>>> What would be the easiest way to do that?
>>>>>>>>
>>>>>>> --
>>>>>> 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/S0CYsynRi7E/unsubscribe.
>>>>>> To unsubscribe from this group and all its topics, 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/8caaedbc-ba59-4c92-aa24-2b345048da1b%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/tiddlywiki/8caaedbc-ba59-4c92-aa24-2b345048da1b%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
> 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/S0CYsynRi7E/unsubscribe.
> To unsubscribe from this group and all its topics, 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/ddf9004b-6bd6-4e82-93fa-de03f5d7b293%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/ddf9004b-6bd6-4e82-93fa-de03f5d7b293%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAGFCNLwt6nhVZc1WQisQ-XH9qcsx8NW%3DpynFUcJk1mJ_OryTLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to