How to enter a 'new line' character into a text string

If you're writing a whole paragraph, the way to do it is in a comment, where you can include newlines to your heart's content. I use newlines in the help text for library blocks to control the formatting of the help screen.

And Eisenberg's law suggests there should be a programmatic way of creating and editing comments.

"\n" is an escape sequence only for string literals, usually interpreted during parse. It's quite uncommon to interpret escape sequences by runtime engine as it is left to user code.

Multiline or not is a matter of choice for built-ins, but for user procedures only neglectible effort is required.

It is for the Snap! designers - Nothing would break were they to change it since one can currently copying paste multi-line text into any of the built-ins.

This arose because I needed it in join - yes I can do the following but is that negligible effort?


But isn't text in an input field in Snap! a "string literal"?

I didn't know you could do that. does 10 as Unicode mean enter?

This is a special case of the general point that we need macros! It'll happen.

It is if you're thinking as a Snap! programmer, but not if you're thinking as a JS programmer.

But why do we have to use that ugly \n for newline when instead we can use an actual newline? Every programming language doesn't have to be C.

Because we can't type actual newlines to builtins like join.

We can if we load the strings library.