Export Forced Line Break (soft returns) to XML
kee nethery
kee at kagi.com
Tue Oct 11 11:14:26 EDT 2005
yes, this is a very common problem.
> The Mac uses the Ascii character 13 (a carriage return) for line
> endings. UNIX uses a linefeed (char 10) and Windows uses both.
> If your text file is intended for the Mac, simply use the "return"
> constant, and save using "file" (not "binfile"), as this will
> covert the returns to the correct line ending character for the
> platform that you are saving on.
> In revolution return is a shorthand for linefeed, or ascii 10, and
> end of line translation is performed in the appropriate cases. For
> more information take a look at the Rev documentation on return.
When the Mac is doing the processing and the file has to go to some
other platform, or the receiving application insists the file get
written a specific way regardless what revolution thinks, you have to
save the file to disk using binfile and write the ascii values, avoid
the constant "return" because ... it's not really a constant (it
changes).
If you are accepting data into a text field and it's via copy and
paste, I'm not sure how to retain the ascii(10) and ascii(13) values
within revolution.
If you are accepting data via reading a file ... read it with binfile
to retain that data.
on flame
With all software there is a line in how far to go to make
things easy for programmers. \
The problems with a language pop up when the language goes over
that line and you \
actually don't want it to automatically do what it is doing.
Then you fight the language \
to get it to do what you want.
I'd really would have preferred that the runrev team leave
constants constant and to \
create a new constant that is
lineEnd
that varies by platform. But, they chose to make a constant
(return) not be constant \
and it is hell.
end flame
Kee Nethery
More information about the use-livecode
mailing list