Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error table for VFP 60
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00363268
Message ID:
00363331
Vues:
12
Thanks, Mark & George.
********************************************************************
*  Description.......: PopulateErrorsTable
*  Calling Samples...: 
*  Parameter List....: 
*  Created by........: Nadya Nosonovsky 04/25/2000 04:00:24 PM 
*  Modified by.......: 
********************************************************************
on error do InsertErrors

for i=1 to 2035 && Total number of errors
 if i=1116
   * Skip
 else  
      error(i) && Simulate an error (thanks Mark Mccasland)
 endif      
next
brow
on error         
**********************************************  
function InsertErrors
*!*     Element number Description 
*!*     1 Numeric. The number of the error. Identical to the value returned by ERROR( ). 
*!*     2 Character. The text of the error message. Identical to the value returned by MESSAGE( ). 
*!*     3 The null value. However, if the error has an additional error parameter, contains the text of the error parameter. Identical to the value returned by SYS(2018). 
*!*     4 The null value. However, as appropriate, contains the number of the work area in which the error occurred. 
*!*     5 The null value. However, if a trigger failed (error 1539), contains one of the following numeric values:
*!*     1 – Insert trigger failed.
*!*     2 – Update trigger failed.
*!*     3 – Delete trigger failed. 
*!*     6 The null value. 
*!*     7 The null value. 


*!*     The following table describes the contents of each element when OLE errors numbered 1427 or 1429 occur. When these OLE errors occur, the array contains one row.

*!*     Element number Description 
*!*     1 Numeric. Contains 1427 or 1429. 
*!*     2 Character. The text of the Visual FoxPro error message. 
*!*     3 Character. The text of the OLE error message. 
*!*     4 Character. The application name (for example, Microsoft Excel). 
*!*     5 The null value or Character. Contains the name of the application's Help file where more information about the error can be found if the information is available from the application; otherwise contains the null value. 
*!*     6 The null value or Character. Contains the Help context ID for the appropriate Help topic if the information is available from the application; otherwise contains the null value. 
*!*     7 Numeric. An OLE 2.0 exception number. 


*!*     The following table describes the contents of each element when an ODBC error numbered 1526 occurs. When an ODBC error occurs, the array contains two or more rows; one row for each ODBC error.

*!*     Element number Description 
*!*     1 Numeric. Contains 1526. 
*!*     2 Character. The text of the error message. 
*!*     3 Character. The text of the ODBC error message. 
*!*     4 Character. The current ODBC SQL state. 
*!*     5 Numeric. The error number from the ODBC data source. 
*!*     6 Numeric. The ODBC connection handle. 
*!*     7 The null value. 

if error()<>1941 && Error # is  valid
  insert into VFPErrors (errnum, errmessage) ;
          values (error(), message())
endif
>>>>Does anyone know where I can get a listing of VFP errors and their meaning?
>>>>
>>>>Thanks, Dave <:)
>>>
>>>The help file has a listing both by number and alphabetical. In VFP it's pretty easy to build your own error table with these values. Just loop through all values from 1 to 2035, store the error number and message. Be sure, however, to trap for error 1941 (Error code is not valid).
>>
>>I have also had to just flat out skip error #1116 - Too many windows open. This error always went to a VFP messagebox with just an OK button and never would get sent to the error trap routine. When I first did what you suggested months ago, I thought there was a real problem with too many windows open. I rebooted, Ctrl-Alt-Del to see if anything was not responding in the task list, pulled hair. Then realized the error proc was being bypassed. Try the following:
>>on error do pNothing
>>
>>error(1116)
>>
>>on error
>>
>>procedure pNothing
>>*
>>wait window nowait "Error proc fired..."
>>return .t.
>
>Thanks, Mark. I'd done this so long ago that I didn't remember this one. (Still don't for that matter, but at my age it's to be expected< g >).
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform