Advertisement

05.29.2008 at 10:44AM PDT, ID: 23442283
[x]
Attachment Details

CFLoop List Problem

Asked by bhlang in ColdFusion Application Server, Cold Fusion Markup Language

I have a field in a query that is a tab-delimited list.
I'm trying to use CFLoop to output the items of this list and I'm seeing some weird results.
Code and sample below.

It looks like the CFLOOP is showing each element multiple times for some reason. Any ideas on how I can fix it?
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
<cfquery name="getEmail" datasource="#Application.DSN#">
	SELECT mDate, mFrom, mSubject, mAttachments
	FROM EmailNews
	ORDER BY mDate DESC 
</cfquery>
<table>
<cfoutput query="getEmail">
	<tr>
		<td>#getEmail.mDate#</td>
		<td>#getEmail.mFrom#</td>
		<td>#getEmail.mSubject#</td>
		<td><cfif Trim(getEmail.mAttachments) neq "">
				<cfset AttachmentList = Replace(getEmail.mAttachments,chr(9),",","All")>
				<cfloop list="#AttachmentList#" index="ListItem">
					<cfoutput>#ListItem#<br></cfoutput>
				</cfloop>
			<cfelse>
				n/a
			</cfif></td>
	<td>#ListLen(getEmail.mAttachments,chr(9))#</td>
	</tr>
</cfoutput>
</table>
<!--- OUTPUT FOLLOWS --->
<table>
	<tr>
		<td>2008-05-28 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>[Everyone] attached</td>
		<td> golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br>
			golf tournament sign up list.xls<br></td>
		<td>1</td>
	</tr>
	<tr>
		<td>2008-05-28 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>Testing read and delete</td>
		<td> n/a </td>
		<td>0</td>
	</tr>
	<tr>
		<td>2008-05-28 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>Yet Another Test</td>
		<td> n/a </td>
		<td>0</td>
	</tr>
	<tr>
		<td>2008-05-28 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>Yet Another Test 2</td>
		<td> Matterhorn.jpg<br>
			Matterhorn.jpg<br>
			Matterhorn.jpg<br>
			Matterhorn.jpg<br>
			Matterhorn.jpg<br></td>
		<td>1</td>
	</tr>
	<tr>
		<td>2008-05-27 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>[Everyone] Alarm</td>
		<td> n/a </td>
		<td>0</td>
	</tr>
	<tr>
		<td>2008-05-27 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>Another Test Message</td>
		<td> fw-08-fraser-valley.pdf<br>
			fw-08-fraser-valley.pdf<br>
			fw-08-fraser-valley.pdf<br></td>
		<td>1</td>
	</tr>
	<tr>
		<td>2008-05-27 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>Multi-Attach Test</td>
		<td> Derby-Take-Out-Menu.pdf<br>
			Derby-Take-Out-Menu.pdf<br>
			DerbyMenu.pdf<br>
			DerbyMenu.pdf<br></td>
		<td>2</td>
	</tr>
	<tr>
		<td>2008-05-27 12:00 AM</td>
		<td>"Brian Lang" <brilang@example.com></td>
		<td>Another attachment test</td>
		<td> PGC Prospect Sources.pdf<br>
			Temporary Importation Bond shipment notification.pdf<br>
			Google AdWords Nov 28 2007.pdf<br></td>
		<td>3</td>
	</tr>
</table>
[+][-]05.29.2008 at 03:19PM PDT, ID: 21673824

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 02:33AM PDT, ID: 21676288

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: ColdFusion Application Server, Cold Fusion Markup Language
Sign Up Now!
Solution Provided By: dgrafx
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.30.2008 at 08:31AM PDT, ID: 21678699

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 08:32AM PDT, ID: 21678718

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:09AM PDT, ID: 21679091

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.30.2008 at 09:14AM PDT, ID: 21679129

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:20AM PDT, ID: 21679197

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:26AM PDT, ID: 21679244

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:32AM PDT, ID: 21679293

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:40AM PDT, ID: 21679351

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 11:31AM PDT, ID: 21680256

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.31.2008 at 05:46AM PDT, ID: 21683568

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628