Well, no, I need to add a line of SQL, one line per value using the OR
connector between statements.  I am sure I have used loop counters
inside a cfloop inside a SQL statement  before... 


Regards, 

Eric 

-----Original Message-----
From: Ian Skinner [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 10, 2005 2:13 PM
To: CF-Talk
Subject: RE: List loop current row

Ummm am I missing something, but presuming the list is a comma separated
list, and you want to output it as a comma separated list, what is wrong
with:

#LIST#?


--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA
 
"C code. C code run. Run code run. Please!"
- Cynthia Dunning

.....-----Original Message-----
.....From: Barney Boisvert [mailto:[EMAIL PROTECTED]
.....Sent: Thursday, March 10, 2005 12:10 PM
.....To: CF-Talk
.....Subject: Re: List loop current row
.....
.....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:198419
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

Reply via email to