Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error Handling routine
Message
From
03/10/2006 23:35:56
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Error Handling routine
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01159209
Message ID:
01159209
Views:
73
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.
Next
Reply
Map
View

Click here to load this message in the networking platform