Page 1 of 1

How to create a new line (return) in live code

Posted: Thu Jul 12, 2012 4:13 pm
by TrevorDowdle
Hey,

Lets say I am trying to get the following string -

"Hello
World"

I don't know how to make it so that there is a new line between Hello and World
This is currently how my code looks.

Code: Select all

put "Hello" &\
   "World" into myString
"HelloWorld"

How can I make a new line in live code?

Thanks

Re: How to create a new line (return) in live code

Posted: Thu Jul 12, 2012 4:21 pm
by sturgis
look in the dictionary for:

cr (synonym is return)
crlf
lf

to do what you want would be something like this

Code: Select all

put "Hello" & cr & "world" into myVariable
Good beginner resources:
http://lessons.runrev.com/
http://www.runrev.com/developers/lesson ... nferences/

Re: How to create a new line (return) in live code

Posted: Thu Jul 12, 2012 4:30 pm
by TrevorDowdle
Thanks

Re: How to create a new line (return) in live code

Posted: Thu Jul 12, 2012 6:38 pm
by dunbarx
Hi.

You were really very clever to think that making the script (sort of) look like what you wanted your text to look like would work. Adorable, but, well, no.

This is a good start to understand that control characters, like "return", "tab", etc., are part of building, and just as importantly, deconstructing, text in LC.

You will find enormous power in the ability to parse text via any character at all, in fact, and be able to separate, count, reorder or whatever, that text by using those characters as delimiters. Please read the dictionary under "itemdelimiter", and experiment.

In a sense, Sturgis' reply is saying that the return character is the delimiter for lines. There are others, and you need them all desperately. You will soon not know how you lived without them.

Craig Newman