If you're guarenteed that your list doesn't contain duplicates, you can do this:
<cfset last = listLast(list) /> <cfloop list="#list#" index="i"> #i#<cfif i NEQ last>,</cfif> </cfloop> Probably slightly less efficient than adding a counter in there, but I think it's more readable, because it's clear that you're not adding the comma after the last item, rather than having to figure out what the numbers are. cheers, barneyb On Thu, 10 Mar 2005 13:49:50 -0600, Eric Hoffman <[EMAIL PROTECTED]> wrote: > How can I find the current row of a list loop? > > I had the old school cfset I = I + 1 in my SQL query, but it kept > barfing having it in there inside my loop in my SQL query. > > I am trying to basically say, look for this value , and if this is not > the last of the comma delimited list sent me, then put OR, otherwise > move on. > > <cfset listnum = listlen(form.area)> > <cfif form.area neq ''> > AND ( > <cfloop list="#form.area#" index="m"> > customer_contact.phone LIKE '%#m#%' <cfif listnum LT > currentrow>OR</cfif> > </cfloop> > ) > </cfif> > > Any ideas? Thanks! -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198256 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

