Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Handling routine
Message
De
03/10/2006 23:35:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Error Handling routine
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01159209
Message ID:
01159209
Vues:
74
Dear Experts

For error handling I wrote following procedure in my main prg
ON ERROR DO ERRHAND WITH ;
	ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

PROCEDURE ERRHAND
PARAMETER MERROR, Mess, MESS1, MPROG, MLINENO
MESSAGEBOX('Error number: ' + Ltrim(Str(MERROR)) + Chr(13) + ;
	'ERROR MESSAGE: ' + Mess + Chr(13) + ;
	'LINE OF CODE WITH ERROR: ' + MESS1 + Chr(13) + ;
	'LINE NUMBER OF ERROR: ' + Ltrim(Str(MLINENO)) + Chr(13) + ;
	'PROGRAM WITH ERROR: ' + MPROG, ;
	48, _SCREEN.CAPTION)
But when some error occours, a screen appears as

Programm Error
File "errhand.prg" does not exist.

This dialoge box contains three button: cancel - Ignore - Help
By pressing Cancel or Ignore button this dialog box appears again and again.
Then I have to terminate my Exe from Task Manager by pressing ALT+CTRL+Del.
As a result some dbf got corruption.

What should I do to avoid such situation.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform