1. MLE Text - Format

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C30B64.B1F90CF0
	charset="us-ascii"

Hello all,
If I have a sequence temp = {"hello world", "I love yous", "all"} and I
want to put all this into an MLE with each part of the sequence on a
separate line, how do I do it? Or should I not be using MLE?

I have tried the following flow

... program started etc. etc.
save to database >> temp[1] & "\n" & temp[2] & "\n" & temp[3]	-- I
only want one sequence in the database
... program does other things etc. etc.
load data from database into temp
setText(MyMLE, temp)

but alas I just get black lines for the "\n" line feed. However this
works fine for the printer that's why I wonder if I should be using MLE
or something else.

BTW temp is a sequence stored in a database as shown above with the
linefeeds already imbedded.

Using win32 V58.5, WINXP

Thanks
Tony Steward

------=_NextPart_000_0000_01C30B64.B1F90CF0
Content-Type: application/x-pkcs7-signature;
	name="smime.p7s"

new topic     » topic index » view message » categorize

2. Re: MLE Text - Format

a
a
a
a
aa
a
a

Hi Tony,
I noticed this exact problem just last week.
Use a RichEdit control instead of an MleText.

Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: MLE Text - Format

> but alas I just get black lines for the "\n" line feed. However this
> works fine for the printer that's why I wonder if I should be using MLE
> or something else.
>

Quite a simple fix! MLE text needs a CRLF to make a new line, not just an
LF. For those who don't know, '\r' is carriage-return (CR) and '\n' is
line-feed (LF).    so rather than putting just '\n' after each line, put
"\r\n" and that will solve the problem.

I usually do this:

-- begin sample code --

global constant CRLF = "\r\n"

global procedure putLines( integer id, sequence lines )
-- writes a sequence of lines to an MLE text
sequence outText

    outText = ""

    for i = 1 to length(lines) do
        outText &= lines[i] & CRLF
    end for

    setText( id, outText )
end procedure

global procedure addLines( integer id, sequence lines )
-- same as putLines() but appends, rather than overwrites
sequence outText

    outText = getText( id ) & CRLF

    for i = 1 to length(lines) do
        outText &= lines[i] & CRLF
    end for

    setText( id, outText )
end procedure

-- end sample code --

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu