EasyManua.ls Logo

Radio Shack TRS-80 Model 3 - Page 155

Radio Shack TRS-80 Model 3
276 pages
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...
INPUT
#-1,
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 statementis 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 dataerror will occur.
If
there are not enough data items on the tape to "fill" the
INPUT statement, an
Out
of
Dataerror will occur.
The
Input
list must beidentical 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 putcassette machine in Play mode. Now run the following
program.
10
INPUT
#-1,
Ai,
B$,
L$
20
PRINT A1,
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 datafile is, so long as:
1)
the file was created
by
successive
PRINT#
statements identical in form to
line 10
2) the last itemin the last data triplet
is'
'THAT'S
ALL" .
3/13

Related product manuals