Files
BlitzNext/_release/help/commands/2d_commands/EOF.htm
T
2014-12-08 12:43:20 +13:00

55 lines
1.5 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>Eof (filehandle/stream)</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
filehandle/stream = a valid variable set with the OpenFile, ReadFile command, or OpenTCPStream (v1.52+)
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Checks to see if the End of File of an opened file or stream has been reached. Use this to determine if you should continue to pull more information from a file/stream or not. Use this to read a text file of unknown length (say a README.TXT) and display it. See example.
<br />
<br />
Eof returns 1 if eof has been reached or, in the case of a TCP stream, the stream has been 'nicely' closed.
<br />
<br />
Eof returns -1 if something has gone wrong during stream processing.
<br />
<br />
Streams can only be used in Blitz Basic v1.52 or greater.
</td>
</tr>
</table>
<h1><a href=../2d_examples/Eof.bb>Example</a></h1>
<table>
<tr>
<td>
; Eof sample
<br />
<br />
file$="c:autoexec.bat"
<br />
<br />
filein = ReadFile(file$)
<br />
<br />
Print "Here is your Autoexec.bat file ..."
<br />
<br />
; Loop this until we reach the end of file
<br />
While Not Eof(filein)
<br />
Print ReadLine$(filein)
<br />
Wend
<br />
</td>
</tr>
</table>
<br>
<a target=_top href=../index.htm>Index</a><br>
<br>
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Eof&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>