The code worked just fine for me. If you are having extra blanks, there
is something wrong with the data or with some other line of code. To
cover all bases, you can write a simple udf to create the list:

function addToList(list,value){
  value = trim(value);
  if(NOT Len(value)) value = "-";
  return ListAppend(list,value,"|");
}
...
emailList = addToList(emailList,fromArray);

If you are not passing this list to HTML, I would use a structure to
store the info instead of a list. This way all your problems are gone
and your code becomes much more readable!

Pascal

> -----Original Message-----
> From: Les Mizzell [mailto:[EMAIL PROTECTED]
> Sent: 07 December 2004 20:29
> To: CF-Talk
> Subject: Re: One More List Question:
> 
> > <cfset emailList = ListAppend(emailList,REReplace(fromArray,"^$","-
> "),"|")>
> 
> 
> I've tried about every combination of REReplace I can thing of,
> including [[:blank:]], but the below will toss an error every single
time.
> 
>   Steve || [EMAIL PROTECTED]
> 
> Note multiple things wrong with this...
> a. space before "Steve"
> b. 2nd element is blank/missing
> c. space before email address.
> 
> Trying to cover all "stupid client tricks" I can come up with...
> 
> I've got "trim" statements applied before this stuff gets written to
the
> database, plus I'm validating the email addresses, but just trying to
> get it divided up like the below when there's an empty position is
> giving me fits...
> 
> 
> <cfset firstname = ListGetAt(emailLIST,1,"|")>
> <cfset lastname = ListGetAt(emailLIST,2,"|")>
> <cfset email = ListGetAt(emailLIST,3,"|")>
> 
> 
> --
> Les Mizzell
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186612
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to