# CHR(13) in Value of textarea

**URL:** <https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596>\
**Category:** macOS\
**Created:** [March 1, 2020, 3:26pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596 "2020-03-01T15:26:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farai\_Aschwanden](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/e79b87/32.png) [@Farai\_Aschwanden](https://forum.xojo.com/u/Farai_Aschwanden)\
**Post date:** [March 1, 2020, 3:26pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/1 "2020-03-01T15:26:14Z")

</div>

Hello

I’m working on Mac and I just found out that a pre-set Value (over GUI) in a textarea uses CHR(13) (Windows) for RETURN. I would expect it would use CHR(10). Then at runtime it really uses CHR(10). I assume the same problem will be on Linux side.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [March 1, 2020, 3:44pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/2 "2020-03-01T15:44:48Z")

</div>

And so the question is ?

---

<div class="post-metadata">

**Author:** ![Farai\_Aschwanden](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/e79b87/32.png) [@Farai\_Aschwanden](https://forum.xojo.com/u/Farai_Aschwanden)\
**Post date:** [March 1, 2020, 3:47pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/3 "2020-03-01T15:47:39Z")

</div>

Is this a bug? Otherwise how I can I set the value on Mac side so that is stored with CHR(10)?

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [March 1, 2020, 3:54pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/4 "2020-03-01T15:54:40Z")

</div>

Use EndOfLine (or eventually EndOfLine.macOS).

[http://documentation.xojo.com/api/code\_execution/end.htmlOfLine](http://documentation.xojo.com/api/code_execution/end.htmlOfLine)  
[http://documentation.xojo.com/api/text/endofline.html#endofline-macos](http://documentation.xojo.com/api/text/endofline.html#endofline-macos) and the two others

Also, look at [http://documentation.xojo.com/api/data\_types/string.html#string-replaceLineEndings](http://documentation.xojo.com/api/data_types/string.html#string-replaceLineEndings)

---

<div class="post-metadata">

**Author:** ![Farai\_Aschwanden](https://forum.xojo.com/letter_avatar_proxy/v4/letter/f/e79b87/32.png) [@Farai\_Aschwanden](https://forum.xojo.com/u/Farai_Aschwanden)\
**Post date:** [March 1, 2020, 4:04pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/5 "2020-03-01T16:04:34Z")

</div>

Thank you… I’m still wondering why Xojo stores text with CHR(13) on Mac

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [March 1, 2020, 4:16pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/6 "2020-03-01T16:16:52Z")

</div>

I am wondering why in the Windows desktop, pressing the Delete key while an item is selected opens the .Parent directory ;).

Seriously, why ?  
Another answer may be: MacOS Legacy.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [March 2, 2020, 9:46am UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/7 "2020-03-02T09:46:07Z")

</div>

Farai,  
It may be best in your scenario, if you’re parsing the incoming text, to use [ReplaceLineEndings](https://documentation.xojo.com/api/data_types/string.html#string-replaceLineEndings) in conjunction with [EndOfLine](http://documentation.xojo.com/api/code_execution/end.htmlOfLine) to get a consistent result:

`var myString as String = TextArea1.Value.ReplaceLineEndings( EndOfLine.Unix )
var lines() as String = myString.Split( EndOfLine.Unix )`

---

<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:** [April 29, 2021, 4:18pm UTC](https://forum.xojo.com/t/chr-13-in-value-of-textarea/52596/8 "2021-04-29T16:18:23Z")

</div>


