Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print and lprint questions
#1
Is there a command that you can use to clear a line or many lines without clearing the entire screen??
ex.
locate 5,1:print cl


With lprint , what is the standard practice for spacing your data and headings? I looked in the qbasic by example book and the tutorials, but nobody mentions it.
Reply
#2
To clear a line:
Code:
qbasicLOCATE 5,1
PRINT SPACE$(lenght);

Where lenght is the X width of the screenmode in characters.. for example.. the default screen 0 is 80x25 characters (X, Y) so to clear a line in screen 0 you would go:

Code:
qbasicLOCATE 5,1
PRINT SPACE$(80);


Also, if you have defined a background color, but would like to have black instead you would have to add:

Code:
qbasicCOLOR , 0
LOCATE 5, 1
PRINT SPACE$(80);


I don't think QBasic has a lprint command...


If you mean the standard way of spacing headers and data with print... I would say: There is none... I don't think there is a general way to display things.. although if you work for a medicine company then you would make the output a certain way.. if you make a game, ten you make it another way...

It's really up to you how you want it actually....
Reply
#3
Space$ is what I was using to clear lines. Just didn't know if there was another way.


For lprint, what is the proper way to put spaces between headers and data?? Can you use tab? Or space$(X) . Just trying to do things the structured and best way.
Reply
#4
K, found LPRINT ( :oops: )


I would use TAB(x)... it's easier to work with:
Code:
qbasicPRINT "Mirp 1"; TAB(12);"BLA!"
PRINT "Mirp 2.7"; TAB(12);"BLI!"
PRINT "Mirp 3 YES"; TAB(12);"BLO!"

Instead of having to adjust the amount of spaces betveen the header and data
Reply
#5
thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)