AT&T 6300 Programmer's Manual page 110

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

Disk File Handling
4-26
ACCESSING A SEQUENTIAL FILE
Program
2
accesses the file "DATA" that was
created in Program 1 and displays the name of
everyone hired in 1978.
10 OPEN ulu,#1,uDATA"
20 INPUT#1,NS,DS,HS
30 IF RIGHTS(HS,2)
=
u78" THEN PRINT NS
40 GOTO 20
RUN
EBENEEZER SCROOGE
SUPER MAN
Input past end in 20
Ok
The program reads, sequentially, every item in
the file. When all the data has been read, line 20
causes an "Input past end" error. This error can
be avoided, however, by inserting an additional
line (line 15 shown below) which uses the EOF
function to test for end-of-file.
15 IF EOF(1) THEN END
Then change line 40 to GOTO 15.

Advertisement

Table of Contents
loading

Table of Contents