Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting carriage returns in a memo field
Message
From
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:
01546613
Views:
53
>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

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform