Page 1 of 1

Newbie Question: Line Breaks?

Posted: Wed Dec 28, 2005 8:11 pm
by Munsie
Hey guys, I just started with QuickBASIC..

I'm just wondering how you put a line break in.. Because I'm playing around with INPUT and PRINT.. but I want to space them out (so each line has one Break in between).. Example:

Code: Select all

What is your name?

Your name is NAME? Wow.

How old are you?

You are EIGHTY NINE? Amazing!
That kinda thing..


~Munsie

Posted: Wed Dec 28, 2005 8:19 pm
by DrV
You can use PRINT without any arguments to jump to the next line:

Code: Select all

PRINT "A"
PRINT
PRINT "B"

Posted: Wed Dec 28, 2005 8:22 pm
by Munsie
Ooohk! Thank you so much!

~Munsie

Posted: Thu Dec 29, 2005 11:13 am
by Michael Calkins
also, just for your info:
chr$(13) is "carriage return"
chr$(10) is "line feed"

In ASCII files, a line break is made by having CHR$(13) followed by CHR$(10). When you are outputing to the screen with PRINT, though, you can use one or the other.
Regards,
Michael

Line Breaks

Posted: Mon Jan 02, 2006 12:10 pm
by Zim
If you're printing to a file, the same concept works:

Code: Select all

Print #1,"A"
Print #1,
Print #1,"B"
...etc...
Just don't forget the comma on the empty Print # statement.