ah ok, well Matt Walker's suggestion will work well for you then :) -----Original Message----- From: James Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, 7 August 2003 2:17 PM To: CF-Talk Subject: RE: Incrementing a counter
I thought of that, but the "j" element of ReasonList is the actual value... Therefore, j is not a number but a string, so I have to use ReasonID as well. James -----Original Message----- From: Gunther Ahamer [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 9:11 PM To: CF-Talk Subject: RE: Incrementing a counter how about <cfset ReasonList = "a,b,d"> <cfset ReasonID = "1,2,4"> <cfif #ReasonList# NEQ ""> <cfoutput>#ReasonList# <br> #ReasonID# <br></cfoutput> <cfloop list="ReasonList" index="j"> <cfset id = #ListGetAt(ReasonID,j)#> <cfoutput>counter = #j# <br></cfoutput> </cfloop> </cfif> -----Original Message----- From: James Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, 7 August 2003 2:04 PM 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 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

