🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.atari16
Article #1896

ST-BASIC EOF() Function

#1896
From: Frans Dorrestein
Date: Mon, 22 Sep 1986 10:06
25 lines
1382 bytes
Am I missing something, or is the ST-BASIC EOF function totally useless?

I tried to read a file upto the end and I wanted to detect eof by means of the
eof function. If I don't include the "on error" statement I get a "You reached
end-of-file" error at line 170, but if I do include the "on error" statement,
then I end up in an infinite loop. 

Here is my ST BASIC program:

100   on error goto 210
110   line%=0
120   open "I",#1,"file.ext"
130   line input #1,buf$
140   while not eof(1)
150       line%=line%+1
160       print line%,buf$
170       line input #1,buf$
180   wend
190   close #1
200   end
210   print "Error";err;"at line";erl        <--- just to see what is going on
220   resume next

Frans Dorrestein.
Technical Details
Message-ID: <37@nvpna1.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!philmds!prle1!nvpna1!dorrestn

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!philmds!prle1!nvpna1!dorrestn
From: dorrestn@nvpna1.UUCP (Frans Dorrestein )
Newsgroups: net.micro.atari16
Subject: ST-BASIC EOF() Function
Message-ID: <37@nvpna1.UUCP>
Date: Mon, 22-Sep-86 06:06:16 EDT
Article-I.D.: nvpna1.37
Posted: Mon Sep 22 06:06:16 1986
Date-Received: Mon, 22-Sep-86 01:46:19 EDT
Reply-To: dorrestn@nvpna1.UUCP (Frans Dorrestein (7)42987)
Distribution: net.micro.atari16
Organization: Philips Research Laboratories Eindhoven
Lines: 24
Keywords: BASIC EOF BUG
Summary: Is there any use for EOF()-function?