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 --
|
Not Categorized, Please Help
|
|