FileNum: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (1 revision)
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
FILENUM
The '''FileNum''' [[internal function]] returns the number of the file that produced the most recent I/O error.
The '''FileNum''' [[internal function]] returns the number of the file that produced the most recent I/O error.


====Comments and Examples====
====Comments and Examples====
;A generalized error-handling routine could include the following statement to print the file number of the file with an error:
 
A generalized error-handling routine could include the following statement to print the file number of the file with an error:


  09000 PRINT "File";FILENUM;"had an error."
  09000 PRINT "File";FILENUM;"had an error."


[[File$]] with no parameters now provides the same information as File$(N). File$ with no parameters even provides the file name when the error was that the file could not be opened, and thus has no file number.
[[File$]] with no parameters now provides the same information as FileNum. File$ with no parameters even provides the file name when the error was that the file could not be opened, and thus has no file number.


====Related Functions====
====Related Functions====
For additional information about files, see the following functions: [[Exists]], [[File$]], [[File]], [[FreeSP]], [[KLn]], [[KPs]], [[KRec]], [[LRec]], [[Rec]] and [[RLn]].
 
For additional information about files, see the following functions:
 
* [[Exists]]
* [[File$]]
* [[File (internal function)]]
* [[FREESP]]
* [[KLn]]
* [[KPs]]
* [[KRec]]
* [[LRec]]
* [[Rec]]
* [[RLn]]


====Technical Considerations====
====Technical Considerations====
# If the current error was not an I/O error, FileNum will be irrelevant because it contains information about a previous error.
# If the current error was not an I/O error, FileNum will be irrelevant because it contains information about a previous error.



Latest revision as of 19:34, 21 May 2014

FILENUM

The FileNum internal function returns the number of the file that produced the most recent I/O error.

Comments and Examples

A generalized error-handling routine could include the following statement to print the file number of the file with an error:

09000 PRINT "File";FILENUM;"had an error."

File$ with no parameters now provides the same information as FileNum. File$ with no parameters even provides the file name when the error was that the file could not be opened, and thus has no file number.

Related Functions

For additional information about files, see the following functions:

Technical Considerations

  1. If the current error was not an I/O error, FileNum will be irrelevant because it contains information about a previous error.