dcmultiline wordwrap

This forum is for eXpress++ general support.
Post Reply
Message
Author
bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

dcmultiline wordwrap

#1 Post by bobvolz »

I use DCMULTILINE to enter text for email messages.

The code is as follows:
@ 9,0 DCMULTILINE cText SIZE 90,10 FONT '10.Courier' OBJECT oCtext NOHORIZSCROLL
This code does automatic word wrap on the screen.

The problem I have is that if the user simply keeps typing and lets the wordwrap do its job the resulting email that goes out is one long line of text. It is not completely visible on an email reader box such as AOl or Gmail.

If the user does press the return key at the end of every line the resulting email is fine.

How do I insert a Chr(13)+Chr(10) at the end of every line so that the resulting email message fits into a standard email reader box

I wrap the final cText varaiable with the HTML command <pre> just before I send it.

cText:='<pre>'+cText+'</pre>'

This allows me to send canned messages that may contain some html references and formatting.

Does anyone have an email message screen that doesn't have these issues.

Bob Volz
Meadowland Systems

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dcmultiline wordwrap

#2 Post by rdonnay »

Try this:

Code: Select all

FUNCTION FixText( cText )

LOCAL aText, cOutText, i

aText := DC_StrWrap( cText )
cOutText := ''

FOR i := 1 TO Len(aText)
  cOutText += aText[i] + Chr(13)+Chr(10)
NEXT

RETURN cOutText
The eXpress train is coming - and it has more cars.

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: dcmultiline wordwrap

#3 Post by bobvolz »

Hi Roger;

I got your function to work by adding a numeric var to DC_StrWrap
and then changing the value of cText to cOutText.
Now the emails fit nicely. Thanks again.
Hope all is well with you.

Bob Volz



FUNCTION FixText( cText )

LOCAL aText, cOutText, i

aText := DC_StrWrap( cText,75 )
cOutText := ''

FOR i := 1 TO Len(aText)
cOutText += aText + Chr(13)+Chr(10)
NEXT
cText:=cOutText
RETURN cText

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: dcmultiline wordwrap

#4 Post by skiman »

Hi,

I suppose the following would work also:
cText := memotran(cText,Chr(13)+Chr(10),Chr(13)+Chr(10))

This should give the same result, same lines and lenght, as you entered in your mail screen.
Best regards,

Chris.
www.aboservice.be

Post Reply