EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 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
Page #152 background imageLoading...
Page #152 background image
Chapter
10
I
BASIC
Keywords
EOF
Function
E
OF(
buffer)
Detects the end of a file.
Buffer
is the number assigned
to
the file when you opened it. It
must access an open file.
This function checks
to
see whether all characters up
to
the end-
of-file marker have been accessed
so
that you can avoid "Input
past
end" errors during sequential input.
When used with sequential access files, EOF returns
0
(false),
when the end-of-file record has not been read yet, and
-1
(true),
when it has been read.
When used with direct access files, EOF returns
-1
(true) if the
last executed GET statement was unable
to
read an entire record
because of an attempt
to
read beyond the physical end
of
the file.
Sample
Program
The following sequence
of
lines reads numeric data from
&ta.txt
into the array
AO.
When the last data character in the file is
read. the EOF test in Line 30 is true.
so
the program branches
out
of
the disk access loop.
1470
DIM
A(100) 'ASSUMING THIS
1480 OPEN
"I",
1,
"data.txt"
1490
I%
=
0
1500
IF
EOF(1
1
THEN GOTO 1540
1510 INPUT#I,
A(I%)
1520
I%
=
I%
+
1
1530 GOTO 1500
1540 REM PROG. CONT. HERE AFTER
IS
A
SAFE VALUE
DISK
INPUT
150

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals