EasyManua.ls Logo

Texas Instruments TI-99/4A - Page 149

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
The
EOF
function
cannot
be
used
with
RELATIVE
files
or
with
somp:
.:'l('r'.pssory c1f'vir'p<:,
Tn
thf':~f'
r.::I~f':S,
yOIl
will
np.f'o
to
~reate
your
own
method
for
determining
that
the
end·of·file
has
been
reached.
Onf' ('ommon pno-of-filp: tp.chniQue is to
create
a
last
record
on the
file
that
serves
as
an
end-of-file indicator. It is called a "dummy"
record
because
the
data
it
contains
is
used
only to
mark
the
end
of
the
file
For
examplp:, it mlllr! hf': filled
with
"9's." Whenever the
computer
inputs
a
record,
you
can
check
the
data.
If
it
is equal to
"9's:'
then
the
computer has
reached
end-of-file
and
can
skip
to
the
closing
routine
The
first
example
on
the
right
creates
a
dummy
record. In
the
next
example,
the
computer
checks
for the
dummy
record
as
its end-of-
file technique.
Examples:
>N
EW
>100
OPEN
#2:
"cs1
",SEQUENTIAL
,FIXED,OUTPUT,INTERNAL
>110
READ
A,B,C
>120 IF A=99
THEN
180
>130
E=A+B+C
>140
PRINT
A;B;C;E
>150
PRINT
#2:A,B,C,E
>160
GO
TO
110
>170
DATA
5,10,15,10,20,30,10
0,200,300,99,99,99
>180 PRINT
#2:99,99,99,99
>190
CLOSE
#2
>200
END
>RUN
*
REWIND
CASSETTE
TAPE
Cs1
TIICN
f'RESS
ENTER
*
PRESS
CASSETTE
RECORD
CS1
THEN
PRESS
ENTER
5
10
15
30
10
20
30 60
100
200
300
600
*
PRESS
CASSETTE
STOP
CS1
THEN
PRESS
ENTER
**
DONE
**
>NEW
>100
OPEN
#1:"CS1",INTERNAL,I
NPUT,FlXED
>110
INPUT
#1:A,B,C,E
>120 IF A=99
THEN
160
>130
F=A*E
>140 PRINT
A;B;C;E;f
>150
GOTO
110
>160
CLOSE
#1
>170
END
>RUN
*
PRESS
CASSETTE
PLAY
CS1
THEN
PRESS
ENIER
5 10 15 30 150
10
20
30 60 600
100
200 300 600
6000
Cassette Recorder Information
RELATIVE
file'organization
cannot
be
used
with
Ci:t~~etle
dev
ices.
The
EOF
(End·of·File) function
cannot
be used with files
on
cassette
recorders.
You
may
specify a
record
length
up
to
192
positions (see
"OPEN')
Only
cassette
unit 1
(CS
1)
can
be
used
for
inputting
data,
User's
Reference
Guide
*
REWIND
CASSETTE
TAPe
THEN
PRESS
ENTER
*
PRESS
CASSETTE
STOP
THEN
PRESS
ENTER
**
DONE
**
C~l
CS1
11·129

Other manuals for Texas Instruments TI-99/4A

Related product manuals