ionic77
2005-06-17 14:59:22 UTC
hey everyone, i'm trying to list some bits of information by year, starting
with the current year, and need to do a <cfloop> to do this.
when i start the list like this: <cfloop from="2005" to="1983" index="i"> it
doesn't return any records, but when i reverse it and make it: <cfloop
from="1983" to="2005" index="i"> it works just fine, but puts things in the
wrong order.
is there a way have a loop countbackwards?
my workaround for this is to run the loop from a variable ie:
<cfset years = '2005,2004,2003'>
<cfloop list="#years#" index="i">
is there a better way to do this?
thanks for your help :)
with the current year, and need to do a <cfloop> to do this.
when i start the list like this: <cfloop from="2005" to="1983" index="i"> it
doesn't return any records, but when i reverse it and make it: <cfloop
from="1983" to="2005" index="i"> it works just fine, but puts things in the
wrong order.
is there a way have a loop countbackwards?
my workaround for this is to run the loop from a variable ie:
<cfset years = '2005,2004,2003'>
<cfloop list="#years#" index="i">
is there a better way to do this?
thanks for your help :)