# New Line Delimiter

**URL:** <https://forum.makecode.com/t/new-line-delimiter/1261>\
**Category:** micro:bit\
**Created:** [February 24, 2020, 8:02pm UTC](https://forum.makecode.com/t/new-line-delimiter/1261 "2020-02-24T20:02:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdmacrae](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cdmacrae/32/649_2.png) [@cdmacrae](https://forum.makecode.com/u/cdmacrae)\
**Post date:** [February 24, 2020, 8:02pm UTC](https://forum.makecode.com/t/new-line-delimiter/1261/1 "2020-02-24T20:02:32Z")

</div>

I am wondering how I enter the New Line delimiter from the keyboard on my MacBook Pro (late 2013) under MacOS 10.15.3. I am using

serial.onDataReceived(serial.delimiters(Delimiters.NewLine), function () {  
…  
})

on a USB-connected micro:bit to receive keyboard input from my computer. I have been successful using all of the available delimiters e.g. Colon, Comma, Dollar, Fullstop and Hash, except for NewLine. I have tried a variety of keystrokes and unicodes, including U+2424 which prints in the Terminal, using the Zsh Screen command, as NL. I can use console.log("\n") function to output New Line; but I have not been successful using the OnDataReceived function to recognize the New Line delimiter as input. Any thoughts?

---

<div class="post-metadata">

**Author:** ![mmoskal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mmoskal/32/20_2.png) [@mmoskal](https://forum.makecode.com/u/mmoskal)\
**Post date:** [February 25, 2020, 3:57pm UTC](https://forum.makecode.com/t/new-line-delimiter/1261/2 "2020-02-25T15:57:09Z")

</div>

It’s probably ASCII 13 aka “\r”. But I have not tried it.

---

<div class="post-metadata">

**Author:** ![cdmacrae](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cdmacrae/32/649_2.png) [@cdmacrae](https://forum.makecode.com/u/cdmacrae)\
**Post date:** [February 26, 2020, 5:14pm UTC](https://forum.makecode.com/t/new-line-delimiter/1261/3 "2020-02-26T17:14:41Z")

</div>

Many thanks @mmoskal Your suggestion motivated me to go back and try a variety of New Line Unicodes. It appears that, for MacOS, the New Line delimiter is ASCII 10 or U+000A which, as far as I know, can only be entered, on my MacBook Pro, as Unicode Hex input 000A.

---

<div class="post-metadata">

**Author:** ![NBPat](https://avatars.discourse-cdn.com/v4/letter/n/a698b9/32.png) [@NBPat](https://forum.makecode.com/u/NBPat)\
**Post date:** [July 20, 2020, 12:20am UTC](https://forum.makecode.com/t/new-line-delimiter/1261/4 "2020-07-20T00:20:03Z")

</div>

Yes! I generated a “text from char code” with a value of 10 and printed that.

so, on-screen of MakeCode-Blocks you see **serial write string(text from char code(10))** and it does print a new line on the terminal screen

thanks! Appreciate it!

---

<div class="post-metadata">

**Author:** ![DaveAtKitronik](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@DaveAtKitronik](https://forum.makecode.com/u/DaveAtKitronik)\
**Post date:** [July 22, 2020, 8:09am UTC](https://forum.makecode.com/t/new-line-delimiter/1261/5 "2020-07-22T08:09:43Z")

</div>

0x0A is Line Feed, rather than 0x0D which is Carriage return.  
Its common to have LF/CR as a pair, but Unix type systems tend to strip one of them - IIRC the CR is stripped usually.  
Dave
