JavaScript Editor js editor     Web development 



Main Page

Returns the number of the last file operation error recorded for any file channel.

int _FError(void any)
void any;                     /* Pointer. */

Example

The following example uses _FOpen(В ) to attempt to open a file called Nofile.abc, which presumably doesn't exist. It then calls _FError(В ), which returns error number 2, for "file not found."

Visual FoxPro Code

В Copy Code
SET LIBRARY TO FERROR  

C Code

В Copy Code
#include <pro_ext.h>

void putLong(long n)
{
   Value val;

   val.ev_type = 'I';
   val.ev_long = n;
   val.ev_width = 10;

   _PutValue(&val);
}

FAR Example(ParamBlk FAR *parm)
{
   FCHAN fchan = _FOpen("nofile.abc", FC_READONLY);
   _PutStr("\nAttempted to _FOpen() a file which does not exist.");
   _PutStr("\n_FError() ="); putLong(_FError());
}

FoxInfo myFoxInfo[] = {
   {"FERROR", (FPFI) Example, CALLONLOAD, ""},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also



JavaScript Editor js editor     Web development