up previous next
NewLine

string containing a newline
Syntax
          
NewLine() :STRING

          

Description
This function returns a string containing a newline. It is simply defined as Return Ascii(10); in coclib.cpkg.

In CoCoA-5 newlines will not be allowed in string literals (too often we have forgotten to close the quotes and the rest of our program ends up in the string!). So newlines must be inserted in a very explicit manner.

Example
  Print "a", NewLine(), "b";
a
b
-------------------------------
  Str :=
  "This is a multiline string" + NewLine() +
  "This is the second line"    + NewLine() +
  "This is the third!";
  Print Str;
This is a multiline string
This is the second line
This is the third!
-------------------------------


See Also