Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
smokin_joe #1
CFLOOP De Loop....
I am trying to print out the contents of a session variable, into a 3 column
table (for mailing labels) using cf loop (You may not be able to see it in this
post, but the records (1) (2) (3), etc actually line up in columns and rows) .
The code listing works fine, except, when you look at the output page. (the
listing below is only a snippet, there are actually 10 rows of output, that I
have not included) While each of the records print in the the correct
row/column, I also get the next record in rows, in this example (8) for all of
the rows that have not already printed. If I add record 8 to the list than the
remaining linse display (9), etc.
For some reason the loop "looks" ahead, for lack of a better technical term;
or I am not looping or placing the query in the right place?
Can someone assist?
THANKS
There is (are) 7 mailing labels in the mailing label basket. GREAT... You
Still Have More Room
(1) Jarret Brown (2) Frank Barone
(3) Matt Damon
S 1313 13 Ave Apt 56 W 2 110 Avenue Apt 55
N 323 111 Avenue Apt 443
NY NY,NY 12345 NY NY,NY 11111
Brooklyn NY,NY 12345
(4) Emeril Lapone (5) Kathy Garson
(6) Garth Brooks
S 5345 113 Avenue Apt 4 E 6634 114 Avenue Apt 3 W
2343 115 Avenue Apt 5
Brooklyn NY,NY 12345 Staten Island NY,NY 11111 Queens
NY,NY 22222
(7) Glen Frye
N 423 116 Road Apt 1
Bronx NY,NY 12345
(8)
(8)
(8)
(8)
<table>
<!--- ROW 1 --->
<tr valign="top">
<cfif session.basket.CurrentRow EQ '1'><cfloop query="session.basket"
startrow="1" endrow="3"><cfoutput>
<td width=12 style='width:9.0pt;padding:0in .25pt 0in
..75pt;height:1.0in'>
<p class=MsoNormal
style='margin-top:0in;margin-right:4.75pt;margin-bottom:0in;
margin-left:4.75pt;margin-bottom:.0001pt'></p></td>
<td width=252 style='width:189.0pt;padding:0in .25pt 0in
..75pt;height:1.0in'>
<p class=MsoNormal
style='margin-top:0in;margin-right:4.75pt;margin-bottom:0in;
margin-left:4.75pt;margin-bottom:.0001pt'><font face="Arial, Tahoma,
Verdana" size="2" color="f00000"><b>
(#session.basket.CurrentRow#) #session.basket.SHFirstName#
#session.basket.SHLastName#<br>
#session.basket.Prefix#
#session.basket.BuildingNo# #session.basket.S treetName# #s
ession.basket.Suffix# #session.basket.Apt# <br>
#session.basket.SHCity#
#session.basket.SHState# #session .basket.SHPostalCode#</b></fon
t>
</p></cfoutput></cfloop></cfif></td></tr>
<!--- ROW 2 --->
<tr valign="top">
<cfloop query="session.basket" startrow="4" endrow="6"><cfoutput>
<td width=12 style='width:9.0pt;padding:0in .25pt 0in
..75pt;height:1.0in'>
<p class=MsoNormal
style='margin-top:0in;margin-right:4.75pt;margin-bottom:0in;
margin-left:4.75pt;margin-bottom:.0001pt'></p></td>
<td width=252 style='width:189.0pt;padding:0in .25pt 0in
..75pt;height:1.0in'>
<p class=MsoNormal
style='margin-top:0in;margin-right:4.75pt;margin-bottom:0in;
margin-left:4.75pt;margin-bottom:.0001pt'><font size="2"
color="f00000"><b><font face="Arial, Tahoma, Verdana">
(#session.basket.CurrentRow#) #session.basket.SHFirstName#
#session.basket.SHLastName#<br>
#session.basket.Prefix#
#session.basket.BuildingNo# #session.basket.S treetName# #s
ession.basket.Suffix# #session.basket.Apt# <br>
#session.basket.SHCity#
#session.basket.SHState# #session .basket.SHPostalCode#</b></fon
t>
</p></cfoutput></cfloop></td></tr>
<!--- ROW 3 --->
<tr valign="top">
<cfloop query="session.basket" startrow="7" endrow="9"><cfoutput>
<td width=12 style='width:9.0pt;padding:0in .25pt 0in
..75pt;height:1.0in'>
<p class=MsoNormal
style='margin-top:0in;margin-right:4.75pt;margin-bottom:0in;
margin-left:4.75pt;margin-bottom:.0001pt'></p></td>
<td width=252 style='width:189.0pt;padding:0in .25pt 0in
..75pt;height:1.0in'>
<p class=MsoNormal
style='margin-top:0in;margin-right:4.75pt;margin-bottom:0in;
margin-left:4.75pt;margin-bottom:.0001pt'><font size="2" face="Arial,
Tahoma, Verdana" color="f00000"><b>
(#session.basket.CurrentRow#) #session.basket.SHFirstName#
#session.basket.SHLastName#<br>
#session.basket.Prefix#
#session.basket.BuildingNo# #session.basket.S treetName# #s
ession.basket.Suffix# #session.basket.Apt# <br>
#session.basket.SHCity#
#session.basket.SHState# #session .basket.SHPostalCode#</b></fon
t>
</p></cfoutput></cfloop></td></tr>
smokin_joe Guest
-
ASP Do While Loop to CFLOOP
Can anyone show me what the equalivant CFLOOP would be for: Do While Not oSegment Is Nothing -
concat cfloop index to cfoutput variable inside loop?
Hi, STUPID question here: I have a cfloop, index j. I have a text field, DESCRIPTION_#j#, inside the loop. I want to populate the VALUE of the... -
Film loop rollovers working with tell sprite, but only if Loop is checked
on mouseWithin me cursor 280 tell sprite 40 --the sprite containing the film loop sprite(60).member = member("networkmapsbuttonroll") --swapping... -
Urgent: Repeat loop and Film loop clash!
Hi All, Scenario I have a script running in which the spelling which was typed in by the student is corrected. The alphabets are moved to... -
Help with loop inside loop and mysql queries
Hi List. I cannot see my error: I have relation tables setup. main id entity_name main_type etc etc date_in 1 test type1 x y 2003-06-02...



Reply With Quote

