Commodore 64 User Manual page 38

Hide thumbs Also See for Commodore 64:
Table of Contents

Advertisement

Even though this might seem a bit redundant,
what we've done is
simply use both types of print statements
together.
The first part prints
"5 * 9 =" exactly as it was typed. The second part does the actual work
and prints the result, with the semicolon separating
the message part of
the statement
from the actual calculation.
You can separate
the parts of a mixed print statement with punctua-
tion for various formats. Try a comma in place of the semicolon and see
what happens.
For the curious, the semicolon causes the next part of the statement to
be printed immediately after the previous part, without any spaces. The
comma
does something
different.
Even though
it is an acceptable
separator,
it spaces things out more. If you type:
the numbers will be printed across the screen and down on to the next
line.
The Commodore 64's display is organized into 4 areas of 10 columns
each. The comma tabs each result into the next available
area.
Since
we asked for more information to be printed than would fit on one line,
(we tried to fit five 10-column areas on one line) the last item was moved
down to the next line.
The basic difference between the comma and semicolon in formatting
PRINT statements
can be used to our advantage
when creating more
complex displays: it will allow us to create some sophisticated
results
very easily.
29

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore Commodore 64

Table of Contents