How To Use ON ERROR To Debug Applications (178890)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Visual FoxPro for Macintosh 3.0b
- Microsoft FoxPro for Windows 2.5
- Microsoft FoxPro for Windows 2.5a
- Microsoft FoxPro for Windows 2.5b
- Microsoft FoxPro for Windows 2.6
- Microsoft FoxPro for Windows 2.6a
- Microsoft FoxPro for Macintosh 2.5b
- Microsoft FoxPro for Macintosh 2.5c
- Microsoft FoxPro for Macintosh 2.6a
- Microsoft FoxPro for MS-DOS 2.5
- Microsoft FoxPro for MS-DOS 2.5a
- Microsoft FoxPro for MS-DOS 2.5b
- Microsoft FoxPro for MS-DOS 2.6
- Microsoft FoxPro for MS-DOS 2.6a
- Microsoft FoxPro for UNIX 2.6
This article was previously published under Q178890 SUMMARY
FoxPro provides the ON ERROR command to allow programmers to trap specific
errors that occur within applications. This article describes how to use an
error trapping routine that stores relevant debugging information in a
FoxPro table.
The code included in this article traps errors that occur within a FoxPro
application and stores the following information to a table:
- The computer name where the error occurred.
- The error number.
- The error message.
- The line of code where the error occurred if the source code is
available.
- The program file where the error occurred.
- The line number where the error occurred.
- The name of the currently selected table when the error occurred.
- The date and time of the error.
REFERENCES
FoxPro Help, search on: "ON ERROR"; "ERROR()"; "MESSAGE()"; "SYS()";
"PROGRAM()"; "DBF()"; "LINENO()"
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kbcode kbhowto KB178890 |
---|
|