mdav
You need to write a procedure calledd ErrorTrap or similar
ON ERROR DO ErrorTrap WITH ;
[tab]SYS(16),;
[tab]LINENO(),;
[tab]ERROR(),;
[tab]MESSAGE(1),;
[tab]MESSAGE()
*************************
* Procedure: ERRORTRAP
* Syntax: DO ERRORTRAP
* ***********************
PROC ErrorTrap
PARAMETERS lcProgramName,;
[tab]lnLineNumber,;
[tab]lnError,;
[tab]lcErrorMessage,;
[tab]lcErrorType
* Code
ENDPROC
You can add all sorts of other information into the procedure, such as tablename, record no, EOF(), SYS(0), SYS(5), SYS(2003), RELATION(), FILTER() etc, and produce a concatenated mini report which can the be appended into a memo field in a table called ERRORLOG or similar.
At the end of the procedure, DO FORM ERRORLOG, which will then allow you or user to view the error and then CONTINUE, RETRY, QUIT etc.
HTH
Chris