I
1
MORE ABOUT PRINTING ON THE SCREEN
You've probably noticed that certain programs had you type commas in
certain places, while in others there were semicolons. Your computer
interprets commas and semicolons as instructions for the spacing of the
printout
The effect of punctuation on the spacing of PRINT statements works the
same with spacing of both text in quotes (called "text strings") and
numbers being calculated. Try typing this brief program
NEW
10 PRINT "0","K"
20 PRINT
"0";"K"
Notice that the punctuation appears OUTSIDE of me quote marks.
When you RUN the program. the screen looks like this:
0
line 10 PRINTed this
OK
line 20 PRINTed this
If line 10 and line 20 are nearly identical, why is there such a difference
in what they PRINT on the screen? The only difference is due to the
punctuation between the items this program PRINTs.
When you use a comma to separate items in a PRINT statement. the
items are PRINTed several spaces apart. When you use a semicolon,
the items are PRINTed right next to each other.
As you recall, your computer's screen has 40 columns across. These
columns are divided into four 10 space areas, ceded PRINT ZONES.
When you use a comma to separate PRINTed items, your Commodore
16 PRINTs the first item in the first print zone. tne second item in the
second print zone, etc. The commas work like tabs on a typewriter.
spaces the letters like this on your screen:
1 I1 21 31 40 COLUMN
ROW 1
A
B
C
D
2 E F
When you use semicolons to separate items in a PRINT statement, your
Commodore 16 ignores the print zones and PRINTS all the items one
alter another
PRINTs this
.
ABCDEF
II the first PRINT item is 12 letters long and the second item is
separated by a comma. here's what happens:
PRINT "ABCDEFGHIIKL","M"
PRINTS this:
ZONE 1
ZONE 2
ZONE 3
ABCDEFGHIJKL
NOTE: Sometimes you'll type a particularly long line on your
computer, such as this:
10 PRINT "I LIKE YOUR TOUCH ON MY KEYBOARD. DO YOU
COME HERE OFTEN?"
PRINT ZONE I
PRINT ZONE 2
PRINT ZONE 3
PRINT ZONE 0
: •
• 0 1
It 11.•11'? '1 1 1 l•
tInIsix 71277:i It 7;145:7 :11:6
103.1 t2 11 34 IS 14137 la Tr 4
CO.ukt45
IC
You'll notice that as you type this. you run out of room on one row. But
keep typing: the Commodore 16 automatically moves on to the next
f
row and continues printing there until your line is finished. You can type
as many as 80 characters on one program line (up to two full 40-column
rows)
.
Now try RUNning this one iine program. The message is printed on two
II you try to PRINT more than four items separated by commas. your
computer automatically goes to me next line to PRINT. For example:
58
59
Need help?
Do you have a question about the Commodore 16 and is the answer not in the manual?
Questions and answers