home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 27.8. An error handler used for dealing with missing databases.
- Author: Craig Yellick
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- function MissingDBF(errObj, origBlock)
- /*
- Special-purpose error handler for missing databases.
- */
- #include "ERROR.CH"
- local result
-
- /*
- Check to see if the error is an Open Error.
- If so, report the error and BREAK back to the
- local section of code.
- */
- if errObj:genCode == EG_OPEN
- @ 0,0 say "Error: All database files were not opened."
- break
-
- /*
- Error isn't what this function is designed to handle, so
- pass the error along to the original error handler.
- Before passing it along we use the cargo instance variable
- to tack on a reminder of where the error has been. This
- might be useful in debugging. If several error handlers pass
- along the error they can all tack on a message to the cargo
- string.
- */
- else
- if valtype(errObj:cargo) <> "C"
- errObj:cargo := ""
- endif
- errObj:cargo += "(Passed along from MissingDBF)"
- result := eval(origBlock, errObj)
- endif
-
- return result
-
- // end of file CHP2708.PRG
-