Thanks for the suggestion.  That was a simplified example that I was
testing with to resolve this problem, and the actual production string
has roughly 20 fields I need to get at.

-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 21, 2008 2:52 PM
To: CF-Talk
Subject: Re: listGetAt comma problem

btw... strictly a matter of preference here, but *if* you know you're
only going to have 2 list elements, i generally go with listFirst()
and listLast() in place of the listGetAt() function.  One less
argument to type in :)

On Jan 21, 2008 11:46 AM, Sonny Savage <[EMAIL PROTECTED]> wrote:
> This works:
> <!--- List Delimiter --->
> <cfset custom = 'Yummy Crackers, Inc.*Florida'>
> <cfoutput>Company = #listGetAt(custom, 1, '*')#<br></cfoutput>
> <cfoutput>Location = #listGetAt(custom, 2, '*')#<br></cfoutput>
> <cfloop list="#custom#" index="currentValue" delimiters="*">
>     <cfoutput>#currentValue#<br></cfoutput>
> </cfloop>
>
>
>
> On Jan 21, 2008 2:22 PM, Mark Proper <[EMAIL PROTECTED]> wrote:
>
> > My apologies if you get this twice...first time using this resource
and
> > I did not see the post show up.  Trying it again:
> >
> >
> >
> > I have a string that I knew was going to have commas in it (such as
> > company names or address) so I made the delimiter in the string an
> > asterisk.
> >
> >
> >
> > Here is small example code I've been trying to get working:
> >
> >
> >
> > <cfset custom = 'Yummy Crackers, Inc.*Florida'>
> >
> > <cfloop list="#custom#" index="fields">
> >
> >                <cfoutput>Company = #listGetAt(fields, 1,
> > '*')#<br></cfoutput>
> >
> >                <cfoutput>Location = #listGetAt(fields, 2,
> > '*')#<br></cfoutput>
> >
> > </cfloop>
> >
> >
> >
> > When I do that, Company is "Yummy Crackers" (truncates the ", Inc.)
and
> > it blows up on field 2 saying it doesn't exist.  It works fine if
the
> > company doesn't have a comma in it.
> >
> >
> >
> > Obviously the comma is completely screwing up the logic.  What can I
do
> > to get this working?  I am at a complete loss and under the gun, so
I'm
> > begging for help here.  Begging, literally.
> >
> >
> > This email, and any files transmitted with it, is the
> > property of CCAP and, unless indicated otherwise, is
> > intended only for the individual or entity addressed.
> > This email may contain confidential information.
> > If you are not the intended recipient, or the recipient's
> > authorized agent, you are hereby advised that keeping,
> > using, copying, disclosing or disseminating this communication
> > without CCAP's advance written consent is prohibited.
> > If you have received this email in error, please notify the sender
> > immediately and then delete it.
> > CCAP cannot accept liability for any loss or damage caused by
software
> > viruses and advises that you carry out your own virus checks on any
> > attachment to this message.
> >
> >
> >
> >
> >
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297020
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