EasyManua.ls Logo

Texas Instruments TI-99/4A - Page 148

Texas Instruments TI-99/4A
204 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
Using Pending Inputs
A
pendmg
mput
conditIOn
IS
established when
an
INPUT
statement
with a trailing
comma
is performed. When the
next
INPUT
statement
using
that
file is
encountered.
one
of
the
following actions
will occur:
If
the
next
INPUT
statement
has no
REC
clause
- the
computer
uses the
data
in the 110 buffer beginning
where
the previous
INPUT
statement
stopped
.
If
the
next
INPUT
statement
includes a
REC
clause -
the
computer
terminates
the
pending
input
condition
and
reads
the specified
record
into
the
file's
I/O
buffer.
If
a
pending
input condition exists
and
a
PRINT
statement
for the
same
file is performed, the
pending
input condition is
terminated
and
the
PRINT
statement
is performed
as
usuaL
If
you use a
pending
input
with
fife-number
0,
the
error
message
"INCORRECT
STATEMENT"
is
printed
and
the
program
stops
runmng.
End-of-file
In sequential processing, to prevent an
error
when
the
computer
has no
more
data
to
read,
you will need to notify
the
computer
that
the end
of
the file
has
been
reached. To
make
this
easier
for you.
TI
BASIC includes
an
End-of-File function called
EOF.
Be
sure
to
include the
EOF
statement
immediately before
the
INPUT
statement
which
reads
a sequential file. In this way you
can
easily
cause
the
computer
to
stop
reading
the
input
file
when no
more
data
is available.
The
usual
procedure
is
to
skip
to a
closing routine
when
EOF
is
reached
II·t2H
Examples:
>NEW
>100
INPUT
#O:A,B,
>110
PRINT A;B
>120
GOTD
100
>RUN
?
*
INCORRECT
STATEMENT
IN
100
>NEW
>100
OPEN
#5:NAME$,SEQUENTIAL
,INTERNAL,INPUT,FIXED
>110 IF EOF(S)
THEN
150
>120
INPUT
#S~A,B
>130 PRINT A;B
>140
GOTO
710
>150
CLOSE
#5
>160
END
User"s Reference Guide

Other manuals for Texas Instruments TI-99/4A

Related product manuals