It’s not something I use often, and when I do, I always have to research it again. So, I figured I might as well document it and make it easy on myself next time.

When looping through a query, rather than setup a counter and increment, I find it more convenient to simply use the query row index (CurrentRow). Here’s how it works…

<cfoutput query="someQuery">
        <li>#CurrentRow# the number of the ordered list and the number for variable CurrentRow should match.</li>