Short hand for line feed (ppl)?
03-13-2014, 02:28 PM
Post: #1
 DrD Senior Member Posts: 1,095 Joined: Feb 2014
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.
03-13-2014, 02:57 PM
Post: #2
 Han Senior Member Posts: 1,811 Joined: Dec 2013
RE: Short hand for line feed (ppl)?
You can use "\n" in some cases, but not all commands recognize "\n"

Graph 3D | QPI | SolveSys
03-13-2014, 04:55 PM
Post: #3
 patrice Member Posts: 180 Joined: Dec 2013
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
03-13-2014, 07:30 PM
Post: #4
 DrD Senior Member Posts: 1,095 Joined: Feb 2014
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");
03-13-2014, 07:54 PM
Post: #5
 patrice Member Posts: 180 Joined: Dec 2013
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
03-13-2014, 08:25 PM (This post was last modified: 03-13-2014 08:27 PM by eried.)
Post: #6
 eried Senior Member Posts: 725 Joined: Dec 2013
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? “Everything should be made as simple... you know the rest.

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

My website: erwin.ried.cl
03-13-2014, 09:10 PM (This post was last modified: 03-13-2014 09:11 PM by Han.)
Post: #7
 Han Senior Member Posts: 1,811 Joined: Dec 2013
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? “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
03-13-2014, 09:26 PM
Post: #8
 eried Senior Member Posts: 725 Joined: Dec 2013
RE: Short hand for line feed (ppl)?
You can press enter too :O

Code:
PRINT("Hello World");

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

My website: erwin.ried.cl
03-14-2014, 12:59 AM
Post: #9
 DrD Senior Member Posts: 1,095 Joined: Feb 2014
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-
 « Next Oldest | Next Newest »

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