>>Hi all,
>>
>>I have an edit box on a form where the user can type what they want. a button at the bottom send this via email but the email is set to text/html and I have to leave it this way as other emails get sent automatically that are formatted html. I've been trying but with no success to identify carriage returns in the field and replacing them with a
to try to add some formatting to the email.
>>Any ideas?
>
>Since you can't know what possible combinations of CR and LF may exist in the memo (as I see that the usual tricks didn't work)... here goes (pseudo code):
>
>
nParagraphs=alines(aP, yourmemo, ...< check which parameter to add to skip empty lines, perhaps > )
>lcText=aP[1]
>for i=2 to nParagraphs
> lcText=lcText+"<br/>"+aP[i]
>endfor
>return lcText
>
>Actually, it would look nicer if you used real paragraphs:
>
nParagraphs=alines(aP, yourmemo, ...< check which parameter to add to skip empty lines, perhaps > )
>lcText=""
>for i=1 to nParagraphs
> lcText=<p>lcText+"</p>"+aP[i]
>endfor
>return lcText
AFAIK, Windows system always use CR+LF combination.
For simple I will use this method for any possible combinations
lcText = STRTRAN(STRTRAN(m.lcText, CHR(13)+CHR(10), [<br />]), CHR(10), [<br />])
Regards,
Ony