Forums / Setup & design / while loop / Comment17460

Author Topic

Roy Bøhmer

Tuesday 25 January 2005 10:51:18 am

Comment17460

What about setting a max value of iterations, and inside the loop alter the max-variable?

{let max=1}
{section loop=$array max=$max}
  ...
  {section show=$condition}
     {set max=1}
  {section-else}
     {set max=sum($max,1)}
  {/section}

{section}

I've not tested this piece of code, but it might give you some ideas.

Roy