Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

How to add a counter on a Control Loop??


Reply

6 Posts   3776 Views

Avatar
b0bro

11 August 2009 at 12:24pm Community Member, 38 Posts

How do i count a control loop?

Basically, i want to print some extra code every 3 times it goes through a loop.

eg

<% control LatestExhibtion %>

*** If this third time echo <br />

<% end_control %>

Avatar
Hamish

11 August 2009 at 6:21pm Community Member, 712 Posts

cross post, see my answer on the other thread.

Avatar
teejay

15 February 2010 at 5:47pm Community Member, 63 Posts

What other thread :)

Avatar
banal

15 February 2010 at 7:38pm Community Member, 901 Posts

You might want to have a look at this http://ssbits.com/manipulating-every-nth-item-in-a-control-loop/

Avatar
Sean

15 February 2010 at 8:54pm Forum Moderator, 921 Posts

SS 2.4 has <% if IsMultipleOf(3) %> which should help :)

Avatar
JRTotten

28 June 2012 at 7:48am Community Member, 3 Posts

or $Pos if you're looking to assign a count to each item