Chapter
10
I
BASIC
Ke.ywords
LINE
INPUT#
Statement
LINE
INPUT#
buffer, variable
Accepts an entire line
of
data from
a
sequential file to
a
string
variable.
Buffer
is the number assigned
to
the file when you opened it.
This statement is useful when you want to read an ASCII format
BASIC program file as data
or
when you want
to
read in data
without following the usual restrictions regarding leading char-
acters and terminators.
LINE INPUT# reads everything from the
first
character up to:
0
the end-of-file
the 255th data character
0
a
carriage return
Other characters encountered-quotation marks, commas, lead-
ing blanks-are included in the string.
Note:
You must place
a
space between LINE and
INPUT#.
Example
If a ASCII format program file looks like this:
10 CLEAR 500
20 OPEN
"I",
1,
"prog"
then the statement:
LINE
INPUT#l,
A$
can be used repeatedly
to
read each program line, one
at
a time.
203