CHR(13) in Value of textarea

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.

And so the question is ?

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

Use EndOfLine (or eventually EndOfLine.macOS).

http://documentation.xojo.com/api/code_execution/end.htmlOfLine
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

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

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”.

Farai,
It may be best in your scenario, if you’re parsing the incoming text, to use ReplaceLineEndings in conjunction with EndOfLine to get a consistent result:

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