Error Event
| Visual FoxPro 9.0 SP2 |
| Error Event (Visual FoxPro) |
| See Also |
|
Occurs when an error occurs in a method at run time. You can add Error event code so that the object can handle errors.
Note |
|---|
|
The Error event occurs only when the error occurs in code. If the Error event does not contain code, the Error event does not occur. If an ON ERROR routine is already on the call stack, the Error event does not occur. |
Tip |
|---|
|
Make sure that you include code that handles errors that you cannot anticipate. Otherwise, the Error event code executes but does not take action to handle the unanticipated error, and the default Visual FoxPro error message will not display. |
PROCEDURE Object.Error LPARAMETERS nError, cMethod, nLine |
Parameters
- nError
-
Contains the Visual FoxPro error number.
- cMethod
-
Contains the name of the method that caused the error. However, if a method calls a user-defined function, and an error occurs within that function, cMethod contains the name of the user-defined function, rather than the name of the method that called the function.
- nLine
-
Contains the line number within the method or user-defined function that caused the error.
Remarks
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic
Note
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08