BASIC
INPUT
#
-I,
item
list
Inputs the specified
number
of
values stored on cassette
and assigns them
to
the
specified variable names.
Example:
50 INPUT #-1,X,P$,T$
When
this statement
is executed, the Computer
will turn on the tape machine, input
values in the order
specified, then turn off the tape
machine and advance to the next
statement. If a
string
is
encountered when the INPUT list
calls for
a
number, a bad
file data error will occur. If there are
not enough data items
on the
tape to
"fill'
'
the
INPUT
statement,
an
Out of Data error
will occur.
The Input list must be
identical
to the
Print list that created the taped
data-block (same
number
and type
of variables
in
the
same sequence.)
Sample Program
Use
the two-line program
supplied in
the
PRINT#
description
to
create a short
data
file. Then rewind the tape to the
beginning of the data
file, make all necessary
connections , and put cassette
machine in Play mode
.
Now run the following
program.
10
INPUT
#~1
5
Al* B*»
L*
20 PR
'INT Ali B*»
L*
30 IF
L*
=
"THAT'S
ALL"
THEN
END
40 REM
PROGRAM
COULD GO
BACK
TO LINE
10
FOR
MORE
DATA
This program
doesn't care how long or
short the data file is, so
long as:
1)
the
file was created by successive
PRINT# statements
identical in form to
line 10
2)
the last item in the last
data triplet is
"THAT'S ALL' '
.
Note:
When
data
tapes are
read-in
or
written-out via
INPUT#, they will transfer at
500 baud no matter
what baud you
specify.
145