Difference between revisions of "EOF"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
(Created page with 'The '''EOF''' Function indicates when the end of a file has been reached. ''Syntax:'' DO WHILE NOT EOF(filenumber%) * Filenumber is the number of the file being read. #…')
 
imported>SMcNeill
(style guidelines)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''EOF''' Function indicates when the end of a file has been reached.
+
The [[EOF]] function indicates that the end of a file has been reached.
  
  
 +
{{PageSyntax}}
 +
: {{Parameter|endReached%%}} =  EOF([#]{{Parameter|fileNumber&}})
  
''Syntax:'' DO WHILE [[NOT]] EOF(filenumber%)
 
  
 
+
{{PageDescription}}
 
+
* {{Parameter|fileNumber&}} is the number of the file being read. '''#''' is not required.
* Filenumber is the number of the file being read. # is not required.
 
 
* Returns 0 until the end of a file. This avoids a file read error.
 
* Returns 0 until the end of a file. This avoids a file read error.
* Returns -1 at the end of the file.
+
* Returns -1 (true) at the end of the file.
 
+
<!-- confusing statement; further details are required: * [[CHR$]](26) can be used to denote the end of a file. -->
 
+
* '''Note that [[GET]] can return invalid data at the end of a file.''' Read [[EOF]] after a GET operation to see if the end of the file has been reached and discard last read.
 
 
 
 
  
  
==Navigation:==
+
{{PageSeeAlso}}
 +
* [[OPEN]]
 +
* [[LOF]], [[LEN]]
 +
* [[INPUT (file statement)]]
 +
* [[LINE INPUT (file statement)]]
 +
* [[GET]], [[PUT]]
  
[[Keyword_Reference_-_Alphabetical|Go to Keyword Reference - Alphabetical]]
 
  
[[Keyword Reference - By usage|Go to Keyword Reference - By usage]]
+
{{PageNavigation}}

Latest revision as of 17:44, 19 September 2017

The EOF function indicates that the end of a file has been reached.


Syntax

endReached%% = EOF([#]fileNumber&)


Description

  • fileNumber& is the number of the file being read. # is not required.
  • Returns 0 until the end of a file. This avoids a file read error.
  • Returns -1 (true) at the end of the file.
  • Note that GET can return invalid data at the end of a file. Read EOF after a GET operation to see if the end of the file has been reached and discard last read.


See also



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page