Post Reply 
Short hand for line feed (ppl)?
03-13-2014, 02:28 PM
Post: #1
Short hand for line feed (ppl)?
Print(char(10)); works ok, but is there a short hand notation that can be used or embedded in a print command for creating a new line? Something like "/n" for example.
Find all posts by this user
Quote this message in a reply
03-13-2014, 02:57 PM
Post: #2
RE: Short hand for line feed (ppl)?
You can use "\n" in some cases, but not all commands recognize "\n"

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
03-13-2014, 04:55 PM
Post: #3
RE: Short hand for line feed (ppl)?
Each PRINT is on a new line already.
So to have a blank line
PRINT("");
Should do what you want.

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
03-13-2014, 07:30 PM
Post: #4
RE: Short hand for line feed (ppl)?
Neither \n nor the "" approach seem to work when concatenated with additional info within a print command. (Something along these lines):

print( "something" + var +<some kind of newline shorthand> + "something else");
Find all posts by this user
Quote this message in a reply
03-13-2014, 07:54 PM
Post: #5
RE: Short hand for line feed (ppl)?
(03-13-2014 07:30 PM)DrD Wrote:  Neither \n nor the "" approach seem to work when concatenated with additional info within a print command. (Something along these lines):

print( "something" + var +<some kind of newline shorthand> + "something else");
PRINT is pretty limited, so the easiest way is:
Code:
print( "something" + var );
print( "something else");

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
03-13-2014, 08:25 PM (This post was last modified: 03-13-2014 08:27 PM by eried.)
Post: #6
RE: Short hand for line feed (ppl)?
(03-13-2014 07:54 PM)patrice Wrote:  PRINT is pretty limited, so the easiest way is:
Pretty limited for what? for drawing? for calculating? Tongue “Everything should be made as simple... you know the rest.

Code:
PRINT("Hello"+CHAR(10)+"World");

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
03-13-2014, 09:10 PM (This post was last modified: 03-13-2014 09:11 PM by Han.)
Post: #7
RE: Short hand for line feed (ppl)?
(03-13-2014 08:25 PM)eried Wrote:  
(03-13-2014 07:54 PM)patrice Wrote:  PRINT is pretty limited, so the easiest way is:
Pretty limited for what? for drawing? for calculating? Tongue “Everything should be made as simple... you know the rest.

Code:
PRINT("Hello"+CHAR(10)+"World");

If we want something like "\n" for repeated use, and prefer to not have to repeatedly type CHAR(10), perhaps the following may be useful:

Code:

nl:=char(10); // create a local variable outside of any program block

// then you can use something like:
print("Hello" + nl + "World");

Any future use of print that requires a newline character can simply use nl in place of char(10) -- smaller source file and less typing.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
03-13-2014, 09:26 PM
Post: #8
RE: Short hand for line feed (ppl)?
You can press enter too :O

Code:
PRINT("Hello
World");

or
Code:
PRINT("Hello"+"
"+"World");

My website: ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
03-14-2014, 12:59 AM
Post: #9
RE: Short hand for line feed (ppl)?
I like the idea of creating a variable to hold the new line string. That solution seems to produce all the desirable features I was after, and helps keep the program structure nice and tidy. Thank for that idea!

-Dale-
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)