You would have to <cfset counter = counter + 1> IncrementValue(counter) returns counter + 1 but you're not actually updating the value of counter.
I a case like this I'd use <cfloop index="counter" from="1" to="#listlen(ReasonList)#"> > -----Original Message----- > From: James Johnson [mailto:[EMAIL PROTECTED] > Sent: Thursday, 7 August 2003 4:04 p.m. > To: CF-Talk > Subject: Incrementing a counter > > Ok, it's getting late... > > How do I increment a counter in a loop? This code isn't working right: > > <cfset ReasonList = "a,b,d"> > <cfset ReasonID = "1,2,4"> > > <cfif #ReasonList# NEQ ""> > <cfoutput>#ReasonList# <br> #ReasonID# <br></cfoutput> > <cfset counter = 0> > <cfloop list="ReasonList" index="j"> > <cfset id = #ListGetAt(ReasonID,IncrementValue(counter))#> > <cfoutput>counter = #counter# <br></cfoutput> > </cfloop> > </cfif> > > What I get is > a,b,d > 1,2,4 > counter = 0 > > Thanks, > James > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

