EasyManua.ls Logo

Commodore Plus 4 - Page 342

Commodore Plus 4
464 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...
330
Using
Peripheral
Devices
120
INPUT*1,NA$,NU$
130
IFNA$=N$THEN160
140
IFASC(NA$)=255THENPRINTN$;"
NOT
POUND":GOTO170
150
R=R+1:GOTO100
160
PRINTN$;IMS
NUI^ER
IS
";NU$
170
CLOSE1:CLOSE15:END
180
PRINT"WHAT
IS
THE
NAME";:INPUTNA$
190
NA$=LEFT$(NA$,10)
200
PRINT"WHAT
IS
";NA$;MIS
NUMBER";:INPUTNU$
210
NU$=LEFT$(NU$,10)
220
R=l
230
PRINT*15,"P"CHR$(2)CHR$(RAND255)CHR$(INT(R/256))CHR$(1)
240
D=DS:IFD=0THEN260
250
IFD=50THENGOTO280:ELSEPRINTDS$:GOTO310
260
INPUT*1,N$
270
IFASC(N$)O255THENR=R+1:QOTO230
280
PRINT#15f"P"CHR$(2)CHR$(RAND255)CHR$(INT(R/256))CHR$(l)
290
D=DS:
IFDO0ANDDO50THENPRINTDS$
:GOTO310
300
PRINT*l,NA$+","+NU$
310
CLOSE1:CLOSE15:END
Line-by-Line
Explanation
10
Open
the
relative
file
called
PHONES
with
record
size
21.
20
If
an
error
occurred,
then
quit.
30
Open
the
command
channel
of
the
disk
drive.
40
If
an
error
occurred,
then
quit.
50
Find
out
if
this
is
add
or
retrieve.
60
If
it
is
add,
go
down
to
line
180.
70
Find
out
the
name
to
search
for.
80
Trim
off
unused
characters.
90
Start
with
record
number
1.
100
Position
file
pointer
to
beginning
of
record.
110
If
an
error
occurred,
then
quit.
120
Get
the
name
and
number
on
this
record.
130
If
it
is
the
correct
name,
go
down
to
line
160.
140
If
the
record
has
never
been
used,
the
search
has
failed.
150
Go
on
to
the
next
record.
160
Print
out
the
name
and
number.
170
Close
the
files
and
quit.