When CA-Clipper applications are unable to open a file, the reason can be determined by checking the built-in ferror() or doserror() functions. These functions return the DOS error number as an integer numeric value. The ferror() function returns the error number from the last low-level (binary) file operation. The low-level functions include fclose() , fcreate() , ferase() , fopen() , fread() ,freadstr() , and frename() . If there is no error, ferror() returns zero. The doserror() function returns the error number from various other file operations, like opening a DBF file (with use filename ) or an index (set index to filename ). Specifically, the doserror() value is set by CA-Clipper when it creates the runtime error object which is later passed to the error handler. The default error handler displays an alert box with the choices Quit, Retry, and Default. If the failed operation has no associated DOS error, then doserror() returns zero. Since both of these functions return only a number, the error can often be unclear. The DosErrMsg() function (see below) converts the number into a more readable message. Notice that this so-called "DOS" error list includes errors that occur in the network shell, as well as memory and printer errors. The DOS error is also properly reported to CA-Clipper programs running under the various versions of Windows. |
|
Tidak ada komentar:
Posting Komentar