Here's a function for CF 5:

 call it like <cfset mybody = makeNiceEmail(mybody,70)>

<cfscript>
function makeNiceEmail(string, theLength) {
 CRLF=chr(13);
 for (i=theLength-1;i LTE Len(string);i=i+theLength){
   string = Insert(CRLF,string,i);
 }
 return string;
}
</cfscript>

tom
www.basic-ultradev.com

"Dennis Powers" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> It has been a long working weekend and my brain is suitably befuddled at
the
> moment.  I am attempting to format text for use in an email or a RAW text
> file and wish to insert a carriage return/line feed at the closest space,
> with out breaking the words, to the 60-70 characters point for each line.
>
> I am pulling text data out of a database that only has CR/LF breaks at the
> paragraph level. The paragraphs can run several hundreds words (don't
ask -
> it's PhD speak stuff) I need to create text files from the data with CR/LF
> breaks inserted within the paragraphs to break at a space within the
> 60-70-character point.
>
> I am sure someone has done this before and am hoping that you might be
> willing to take pity on one of your fellow CF'ers and share some code.
>
>
> Best regards,
>
> Dennis Powers
> UXB Internet
> (203)879-2844
> http://www.uxbinfo.com/
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to