# Generic line feed

**URL:** <https://forum.xojo.com/t/generic-line-feed/20067>\
**Category:** Getting Started\
**Created:** [October 30, 2014, 12:16pm UTC](https://forum.xojo.com/t/generic-line-feed/20067 "2014-10-30T12:16:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakob\_Krabbe](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/71e660/32.png) [@Jakob\_Krabbe](https://forum.xojo.com/u/Jakob_Krabbe)\
**Post date:** [October 30, 2014, 12:16pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/1 "2014-10-30T12:16:02Z")

</div>

[http://forums.realsoftware.com/viewtopic.php?f=10&t=30944](http://forums.realsoftware.com/viewtopic.php?f=10&t=30944)

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]

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [October 30, 2014, 12:26pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/2 "2014-10-30T12:26:44Z")

</div>

Use ReplaceLineEndings.

---

<div class="post-metadata">

**Author:** ![Jakob\_Krabbe](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/71e660/32.png) [@Jakob\_Krabbe](https://forum.xojo.com/u/Jakob_Krabbe)\
**Post date:** [October 30, 2014, 12:59pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/3 "2014-10-30T12:59:13Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Jon\_Ogden](https://forum.xojo.com/user_avatar/forum.xojo.com/jon_ogden/32/494_2.png) [@Jon\_Ogden](https://forum.xojo.com/u/Jon_Ogden)\
**Post date:** [October 30, 2014, 1:04pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/4 "2014-10-30T13:04:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [October 30, 2014, 1:06pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/5 "2014-10-30T13:06:04Z")

</div>

> [@139854:@Jakob Krabbe](#):
>
> What about saving a text file…?

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.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [October 30, 2014, 1:08pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/6 "2014-10-30T13:08:24Z")

</div>

> [@139834:@Jakob Krabbe](#):
>
> 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?

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.

---

<div class="post-metadata">

**Author:** ![Jakob\_Krabbe](https://forum.xojo.com/letter_avatar_proxy/v4/letter/j/71e660/32.png) [@Jakob\_Krabbe](https://forum.xojo.com/u/Jakob_Krabbe)\
**Post date:** [October 30, 2014, 2:02pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/7 "2014-10-30T14:02:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:28pm UTC](https://forum.xojo.com/t/generic-line-feed/20067/8 "2020-10-29T17:28:28Z")

</div>


