CHAPTER 6
LINE SPACING AND
FORMS CONTROL
We have learned how to print in many different ways, but so
far we haven’t looked at how to position the printing on the page.
.,
In this chapter we will learn how to:
•Change the vertical spacing
•Change the length of the page
•Set top and bottom margins
STARTING NEW LINES
Up until now the only time we have thought about printing on a new line is when we didn’t want it to happen. We learned that putting a semicolon (;) at the end of a BASIC line will not end the line of printing. So somehow, the computer is telling the printer when to end one line and start another.
There are two codes that are used to end one line and start another. They are carriage return (CHR$(l3)) and line ,feed (CHR$(IO)). Like the espace code, they have been given abbre- viations which you’ll find in many texts (including this one): <CR > and < LF > . The codes are simple, but their action is a little confusing (especially with BASIC). Carriage return is the easiest. Each time that the printer receives a CHR$( 13) it returns the print head to the left margin. It does not advance the paper (if DIP switch
Line feed is more complicated. Each time the printer receives a CHR$(lO) it both advances the paper one line and returns the print head to the left margin, ready to start a new line.
Now to add a little confusion - most (but not all) versions of BASIC add a line feed (CHR$( 10)) to every carriage return (CHR$( 13)) that they send. If your version of BASIC doesn’t do this, then you should turn DIP switch