Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting carriage returns in a memo field
Message
From
22/06/2012 14:48:13
 
 
To
22/06/2012 08:45:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01546530
Message ID:
01546672
Views:
52
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform