Or just use ListAppend() instead of trying to make a list  manually...

Russ 

-----Original Message-----
From: Dawson, Michael [mailto:[EMAIL PROTECTED] 
Sent: 31 August 2006 04:38
To: CF-Talk
Subject: RE: YesNoFormat() is cool!

Here's my little, cool, BIF tip:

If you have a loop to build a string, sometimes you may end up with a
trailing comma such as:

"Monday,Tuesday,Wednesday,"

There are a few ways around this:
1. Use an IF statement to test for the end of the loop and not add the last
comma.
2. Use the REReplace() function to remove a comma that exists at the end of
the string.
3. My favorite: Use ListQualify() with the same delimiter.
ListQualify() will "fix" your list and remove any trailing delimiters.
The list above will be: "Monday,Tuesday,Wednesday".

Also, it will fix multiple delimiters such as:

"Monday,,Wednesday,Thursday,"  -->  "Monday,Wednesday,Thursday"

M!ke

-----Original Message-----
From: Mkruger [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 30, 2006 10:17 PM
To: CF-Talk
Subject: RE: YesNoFormat() is cool!

That reminds me of a function I did when CF 5 came out. I was so enamoured
with UDFs that I created this nifty function to add single quotes around a
list of values for use inside of a query "IN"
statement... I showed it off to a fellow CF'er and he said... "why not just
use listqualify( )?  ...
doh'!   Then I learned of cfqueryparam and even that fell by the wayside
:)



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251653
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to