Commodore PET User Manual page 283

Table of Contents

Advertisement

Statement 160 prints blank lines between records.
1
n 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 R and 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

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents