Getting line endings straight.

Richard Gaskin ambassador at fourthworld.com
Fri Oct 1 10:27:31 EDT 2010


David Bovill wrote:

> Most of the time we don;t need to worry about line endings - Rev handles
> them for us transparently.
...
> Some gotcha's:
>
>    - A carriage return is numtochar(13) - however LiveCode internally thinks
>    that CR = LF = numtochar(10)
>    - On OSX LiveCode does not write out text using the systems native line
>    endings - it uses the older Mac Classic line endings (presumably for easier
>    compatability)!
>
> The last one I did not know.

Me neither.  Excellent find.  I so rarely use the engine's automatic 
line-changing options that I hadn't come across that before, and in the 
rare case when I do I never noticed because it seems Apple's TextEdit 
renders old-style (ASCII 13) returns just as it does ASCII 10.

Whether this should be changed is an interesting question.  On the one 
hand, it would be nice to remain current, but on the other hand there 
may be many scripts out there that rely on ASCII 13 when on Mac.

How many Mac programs don't render ASCII 13 line endings correctly?

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv



More information about the Use-livecode mailing list