Creates a variable array containing information about the most recent Visual FoxPro, OLE, or ODBC error.
Parameters
-
ArrayName
-
Specifies the name of the array for AERROR( ) to create.
Return Value
Numeric. AERROR( ) returns the number of rows in the array.
Remarks
Example
The following example uses ON ERROR to specify an error handling routine named errhand. An error is generated by issuing a misspelled command (BRWS). The errhand error handling routine uses AERROR( ) to create an array containing error information, and this information is then displayed.
| | Copy Code |
|---|
ON ERROR DO errhand && errhand is the error handler procedure
BRWS && Causes a syntax error
ON ERROR && Restore system error handler
PROCEDURE errhand
= AERROR(aErrorArray) && Data from most recent error
CLEAR
? 'The error provided the following information' && Display message
FOR n = 1 TO 7 && Display all elements of the array
? aErrorArray(n)
ENDFOR |
See Also