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
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
CRLF chould be chr(13) chr(10) shouldn't
long,
which is not likely.
Best regards,
Dennis Powers
UXB Internet
(203)879-2844
http://www.uxbinfo.com/
-Original Message-
From: tom muck [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 04, 2001 12:15 PM
To: CF-Talk
Subject: Re: Formatting Text for Email/Text Files
Here's
PROTECTED]
Sent: Tuesday, September 04, 2001 12:42 PM
Subject: RE: Formatting Text for Email/Text Files
Tom,
Thanks for the idea, but I am stuck with CF 4.0.1 at the moment. However
won't your function just insert at the 70th character regardless of whether
is falls within a word? What I am
True, I didn't read your post clearly. I'm using this for email
attachments. To do what you need to do is a little or a lot more difficult.
You can use list functions to separate the words at the space, adding words
until you are up to 70 characters, or choose an arbitrary length less than
Well, I decided to dig into the project for a friendly word wrap tag and had
just fleshed out what I needed to do, when I said to myself: self (it's
already been a long week) check out the tag gallery.
Low and behold Mr. Joe Cheng of Allaire Corp. wrote a CF_WordWrap tag back
in 9/18/97. it is
6 matches
Mail list logo