Returns the error number of the most recent byte-level input or output error, or 0 if the most recent byte-level method was successful.

Syntax

<oRef>.error( )

<oRef>

A reference to the File object that attempted the operation.

Property of

File

Description

To trap errors, call the File object method in a TRY block. Use the number that error( ) returns in a CATCH block to respond to errors in the byte-level methods of the File object. The following table lists the byte-level method errors that error( ) returns.

Error number

Cause of error

2

File or directory not found 

3

Bad path name 

4

No more file handles available 

5

Can't access file  

6

Bad file handle 

8

No more directory entries available 

9

Error trying to set the file pointer 

13

No more disk space 

14

End of file