ON ERROR DO errHandler WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
USE nodatabase
ON ERROR
&& Restores system error handler.
PROCEDURE errHandler
PARAMETER merror, mess, mess1, mprog, mlineno
CLEAR
? 'Error number: ' + LTRIM(STR(merror))
? 'Error message: ' + mess
? 'Line of code with error: ' + mess1
? 'Line number of error: ' + LTRIM(STR(mlineno))
? 'Program with error: ' + mprog
ENDPROC