[tw5] How to increment a variable in a list

Hi,

I’m blocking on how to increment a counter into a list
I have the following code which display a list of checkbox

I need to set the index in the DataTiddler but in the below example the <<vals_rep>> remains to …
Anyone who has an idea why it’s not working ?

Thanks for your help
Regards

<$list filter="[enlist<projs_list>]" variable =“proj_name_val”>
<$vars vals_rep ={{{ [<vals_rep >add[1]] }}}>
<<vals_rep>>

  • <> <$checkbox tiddler="projs_selection" index=<> checked=<>>
  • I don’t believe that you can increment a variable that way. You might be able to using some sort of recursive function.

    But if you’re using 5.2.0, you now have the counter attribute, so don’t need those extra steps:

    <$vars projs_list=“A B C”>
    <$list filter="[enlist<projs_list>]" variable =“proj_name_val” counter=“vals_rep” >

  • <> <$checkbox tiddler="projs_selection" index=<> checked=<>>
  • as always … just magic !

    Thanks a lot !

    Vpl