EasyManua.ls Logo

Commodore PET - Page 283

Commodore PET
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Statement 160 prints blank lines between records. 1n statement 170. varia-
ble R serves
as
a record cou nter. Line 180 tests to
see
if more than
two
records
have been
read.
When three records have been
read.
the screen
is
full. and the
user
is
asked if a new set of records
is
desired. If
yeso
the record counter Rand the
field counter
Fare
initialized to zero before returning to
read
the next set of
records at line 100. If more records
are
to
be
read.
the program
is
sent to line 100
to GET# the next character. This continues until the user inputs something other
than a Y character or ST=64; at that time the file
is
c10sed
and the program ends.
Figure 5-9 shows a flowchart of the process of lines 100 to 190.
Although GET#
is
similar to INPUT# in some ways.
it
is
more difficult to for-
mat the printout when using GET# if titi
es
and indentation or spacing
is
desired.
Like comparing X$
to
CHR$(131.
other field delimiters or characters would have
to
be
conditionally tested if one desires more than a simple printout.
At
this time vou should feel comfortable manipulating program and data
files. The three file commands PRINT#. INPUT#. and GET#
are
surprisingly simi-
lar.
When using files. make sure that the same logical file numbers
are
used
throughout the program. and that each logical file
is
opened before
it
is
called and
closed before the program
ends.
It
is
also good practice to display messages
on
the screen explaining
what
the
PET
is
doing
so
the user always knows
what
is
happening.
Following
is
a
sam
pie
RUN
of MAIL.
GET:#:2
reading MAIL.
270

Table of Contents

Related product manuals