Posts: 131
Threads: 32
Joined: Mar 2004
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.
Posts: 3,522
Threads: 189
Joined: Dec 2003
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....
Posts: 131
Threads: 32
Joined: Mar 2004
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.
Posts: 3,522
Threads: 189
Joined: Dec 2003
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
Posts: 131
Threads: 32
Joined: Mar 2004