|
EndOfFile | ||
Flag = EndOfFile(ChannelIndex) | ||
Parameters: ChannelIndex = Index of the file channel to check |
||
Returns: Flag= The end of file status. (1= true, 0 = false) |
||
The EndOfFile function checks the current file pointer position of an open file channel. If the file pointer position hits the end of the file, then the function returns a True(1), it not, the function returns a False(0). FACTS: * If you try and read information beyond the length of a file, you will get a run time error. So EndOFFile, GetFilePos & FileSize can help you ensure this never happens. Mini Tutorial: This example first creates a file of strings. Then in the second part, it reloads this file displaying it's contents. Since the number of lines of text is not stored in the file, the loading while loop continues to load strings until the end of the file has been reached.
This example would output.
|
Related Info: | FilePos | FileSize | GetFilePos | OpenFile | ReadFile : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |