Ask a Question related to Macromedia ColdFusion, Design and Development.
-
ionic77 #1
count backwards with cfloop
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 :)
ionic77 Guest
-
CFLoop can't count??
Hi All, what is wrong with the following code. All it is supposed to do is count the records, take the total number of records list them 1 - 10 in... -
Backwards Audio
At some point I am likely going to be interested in knowing how this happened...but for now, I would just like to resolve it. My audio is recording... -
count cfloop query
How can I display the number of times a query loops? Example: <cfloop query="countthis"> ?? </cfloop> So, if the query produced 10 results,... -
SIMPLE Question! - Count <cfloop>
How can I display the number of times a query loops? Example: <cfloop query="countthis"> ?? </cfloop> So, if the query produced 10 results,... -
Backwards Compatibility
Indeed. What use is an upgrade that criples a program's functionality? This shiould be addressed in an upgrade. CS 1.1 or whatever. -
Stressed_Simon #2
Re: count backwards with cfloop
Do this:-
<cfloop from="2005" to="1983" index="i" step="-1">
Stressed_Simon Guest
-
mxstu #3
Re: count backwards with cfloop
The default for most loops is usually increment the counter by +1. Try adding step="-1" to the cfloop.
mxstu Guest
-
ionic77 #4
Re: count backwards with cfloop
thanks for the quick reply! it worked like a charm :)
ionic77 Guest



Reply With Quote

