Generic line feed

In this thread, it’s clear that there are different line feed codes for each platform.
Since I’m developing on all platforms but I can’t do any testing, I just wonder, how to be sure it works.

Let me limit the question!
First, I do a MsgBox… Will this code work on any platform? (I.e mac, Win, Linux?) Or… do I need to check the platform to use different line feed on each platform?

[code] strPage = replaceAll(strPage, “
”, EndOfLine)

MsgBox strPage[/code]

Use ReplaceLineEndings.

It will always work?
What about saving a text file…?

But that’s only for exporting and then importing settings and not really for the human eye.
Also, it’s for later, not that urgent!

If you use EndOfLine in a MsgBox like you asked, it will work correctly on all platforms.

When you’re saving, just use EndOfLine. That way if the file gets opened in another program on that platform it’ll still work right.

In principle, EndOfLine is the good one for the platform you build for. Chr(10) for Mac, Chr(13)+Chr(10) for Windows.

The example you give of replacing
is valid, although I would add

since it too is an EndOfLine in HTML.

Thank you for the input. It’s very helpful!
Now I’ll try it…!
See if theory and reallty can be friends! :slight_smile: