Function FError() Foundation

Retrieves the error code after completion of a low level file function.

Syntax
FError() --> nErrorCode
Return

The return value of FError() is the OS error code of the last file operation performed. The error code is an integer numeric value. If no error occurred, FError() returns zero.

Description

Using the low level file function FError(), errors which occur during the execution of a low level file function can be diagnosed after the file function is complete. FClose(), FCreate(), FErase(), FOpen(), Fread(), FReadStr(), FRename(), FSeek() and FWrite() are all low level file functions. FError() stores the last error code internally until a another low level file function is called.

A description of the error code can be retrieved from the OS/2 command line by entering HELP <nErrorCode>.

Examples
FError()
// In the example an attempt is made to open a non-existent file. 
// The error code is then displayed. 

#include "Fileio.ch" 

PROCEDURE Main 
   LOCAL nHandle := FOpen( "ABCDEFG.DOC", FO_READWRITE ) 

   IF FError() <> 0 
      ? "Error opening the file:", FError() 
   ENDIF 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.