Steve,

Place them in a list and loop over the list. this way you only display
what is not NULL.

ex.

<cfoutput>
<cfset Practice = "john,jane,clyde,bobo,sammy,beth">
<p><cfloop index="i" from="1" to="#listlen(Practice)#"><cfif i GT 1>,
</cfif>#listgetat(Practice,i)#</cfloop></p>
<cfset Practice = "john,,clyde,,sammy,">
<p><cfloop index="i" from="1" to="#listlen(Practice)#"><cfif i GT 1>,
</cfif>#listgetat(Practice,i)#</cfloop></p>
</cfoutput>

so you make the practice variable this:

<cfset Practice =
"#Practice1#,#Practice2#,#Practice3#,#Practice4#,#Practice5#,#Practice6#">

Ian

----------------------
Ian Sheridan
http://www.savagevines.com
----------------------

----- Original Message -----
From: Steve Sawyer <[EMAIL PROTECTED]>
Date: Wed, 25 Aug 2004 23:37:36 -0400
Subject: Displaying commas and hyphens
To: CF-Talk <[EMAIL PROTECTED]>

This is going to be very basic...

I want to display records with varying results, in this case
'Practice1', 'Practice2', �'Practice6'. However, not all members have
6 practices.

I want each 'Practice' record separated by a comma, without out
displaying unnecessary commas. The following is definitely not the way
to go.  Any suggestions?

Thanks in advance.

<ul>  
<cfoutput query="GetMembers">
      <tr>
           <td height="20" colspan="5" align="left" class="style2">
                <li><A
HREF=""> #MI# #LName#</a> - #Status#</li></td>
      </tr>
      <tr>
           <td height="20" colspan="5" align="left"
class="style4">#Practice1#, #Practice2#, #Practice3#, #Practice4#,
#Practice5#, #Practice6#</td>
      </tr>
</cfoutput>
</ul>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to