use the mod operator.

        if the mod(index divided by 2) is other than zero than the number is
odd.

<cfloop index="index" from="1" to="6">
<cfset modnum = index mod 2>
        <cfif modnum neq 0>
                Odd<br>
        <cfelse>
                Even<br>
        </cfif>
</cfloop>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to