> I have a cfloop that loops 6 times, I want to be able to be
> able to output what loop number the current loop is on, and
> tell if the number is even or odd.
You can use the MOD operator, in conjunction with the current loop iteration
value:
<cfloop index="i" from="1" to="10">
Row <cfoutput>#i#</cfoutput> is
<cfif i MOD 2>
odd!
<cfelse>
even!
</cfif>
<br>
</cfloop>
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists