Hello, I have a strange question, I think. Can a delimiter be only one character? I'm trying to do a sql statement and I wanted to use ListAppend and specify the delimiter as "AND"
Example ...
<cfset tmpWhere = ListAppend(tmpWhere,c,"AND")>
But when I view the list I only see "A" as the delimiter.
Is this a bug or is this how it should be?
Thanks, - Charles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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
I'll leave it to others to classify it as a bug or a feature.
I get around it by doing this: <cfset tmpWhere = ListAppend(tmpWhere,c,"~")> and then when done with all my list appends: <cset tmpWhere = replace(tmpWhere,"~"," AND ","all")>
Cheers,
Sam
On Wed, 30 Mar 2005 11:07:53 -0800, Charles Heizer <heizer1-i2BcT+NCU+M@public.gmane.org> wrote:> Hello,> I have a strange question, I think. Can a delimiter be only one character?> I'm trying to do a sql statement and I wanted to use ListAppend and specify> the delimiter as "AND">
Example ...>
<cfset tmpWhere = ListAppend(tmpWhere,c,"AND")>>
But when I view the list I only see "A" as the delimiter.>
Is this a bug or is this how it should be?>
Thanks,> - Charles>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application
-----Original Message----- From: Charles Heizer [mailto:heizer1-i2BcT+NCU+M@public.gmane.org] Sent: Wednesday, March 30, 2005 2:08 PM To: CF-Talk Subject: ListAppend and delimiter question
Hello, I have a strange question, I think. Can a delimiter be only one character? I'm trying to do a sql statement and I wanted to use ListAppend and specify the delimiter as "AND"
Example ...
<cfset tmpWhere = ListAppend(tmpWhere,c,"AND")>
But when I view the list I only see "A" as the delimiter.
Charles Heizer 30 March 2005 23:34:00 [ permanent link ]
I had to do the same. I just wanted to make sure since the extra cfset using the replace could add more overhead.
Thanks, - Charles
On 3/30/05 11:19 AM, "Sam Farmer" <it.asee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
I'll leave it to others to classify it as a bug or a feature.>
I get around it by doing this:> <cfset tmpWhere = ListAppend(tmpWhere,c,"~")>> and then when done with all my list appends:> <cset tmpWhere = replace(tmpWhere,"~"," AND ","all")>>
Cheers,>
On Wed, 30 Mar 2005 11:07:53 -0800, Charles Heizer <heizer1-i2BcT+NCU+M@public.gmane.org> wrote:>> Hello,>> I have a strange question, I think. Can a delimiter be only one character?>> I'm trying to do a sql statement and I wanted to use ListAppend and specify>> the delimiter as "AND">>
But when I view the list I only see "A" as the delimiter.>>
Is this a bug or is this how it should be?>>
Thanks,>> - Charles>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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
Claude Schneegans 31 March 2005 05:43:58 [ permanent link ]
I get around it by doing this:
<cfset tmpWhere = ListAppend(tmpWhere,c,"~")> >> and then when done with all my list appends: >> <cset tmpWhere = replace(tmpWhere,"~"," AND ","all")>
How about simply: <cfset tmpWhere = tmpWhere & " AND " & c>
-- _______________________________________ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: piegeacon-H4aWS73dXuothxE2hwVU1A@public.gmane.org) Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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
I have a strange question, I think. Can a delimiter be only one character?> I'm trying to do a sql statement and I wanted to use ListAppend and specify> the delimiter as "AND">
Example ...>
<cfset tmpWhere = ListAppend(tmpWhere,c,"AND")>>
But when I view the list I only see "A" as the delimiter.>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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
I'll leave it to others to classify it as a bug or a feature.
It's a feature (I think). Not that I've ever had reason to use or allow for alternative delimiters in CF yet...
I get around it by doing this: > <cfset tmpWhere = ListAppend(tmpWhere,c,"~")>> and then when done with all my list appends:> <cset tmpWhere = replace(tmpWhere,"~"," AND ","all")>
FWIW, I use listchangedelims(tmpWhere, ' AND ', '~') in similar circumstances; it's worth noting that arraytolist() also allows a multi-char delimiter - I often build query "where" clauses in arrays and glue them together that way. -- Pete Jordan Horus Web Engineering Ltd http://www.webhorus.net/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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