DO testerr PROCEDURE testerr TRY DO Whoops CATCH TO oExc oExc.COMMENT = [Perhaps Whoops caused this?] DO Oops WITH oExc, 0 ENDTRY MODI FILE (ADDBS(SYS(2023)) + "TryCatchLog.txt") NOWAIT ENDPROC PROCEDURE Oops() LPARAMETERS toExc, tnLevel LOCAL lcErrorInfo, lcPadding lcPadding = REPLICATE(CHR(9), tnLevel) lcErrorInfo = lcPadding + [Exception Object ] + TRANSFORM(tnLevel) + [:]+ CHR(13) + ; lcPadding + [ ErrorNo: ] + TRANSFORM(toExc.ERRORNO) + CHR(13) + ; lcPadding + [ LineNo: ] + TRANSFORM(toExc.LINENO) + CHR(13) + ; lcPadding + [ Message: ] + toExc.MESSAGE + CHR(13) + ; lcPadding + [ Procedure: ] + toExc.PROCEDURE + CHR(13) + ; lcPadding + [ Details: ] + toExc.DETAILS + CHR(13) + ; lcPadding + [ StackLevel: ] + TRANSFORM(toExc.STACKLEVEL) + CHR(13) + ; lcPadding + [ LineContents: ] + toExc.LINECONTENTS + CHR(13) + ; lcPadding + [ Comments: ] + toExc.COMMENT + CHR(13) + CHR(13) =STRTOFILE(lcErrorInfo, ADDBS(SYS(2023)) + "TryCatchLog.txt", 1) IF TYPE("toExc.UserValue") = "O" DO Oops WITH toExc.USERVALUE, tnLevel + 1 ENDIF ENDPROC PROCEDURE Whoops TRY DO Sub2 CATCH TO oExc1 oExc1.COMMENT = [Perhaps sub2 caused this?] THROW oExc1 ENDTRY ENDPROC PROCEDURE Sub2 TRY DO sub3 CATCH TO oExc2 oExc2.COMMENT = [Perhaps sub3 caused this?] THROW oExc2 ENDTRY ENDPROC PROCEDURE sub3 TRY IF 6=MESSAGEBOX('Would you like to throw an error now?',4) ERROR 10 && throws syntax error ENDIF CATCH TO oExc3 oExc3.COMMENT = [The user decided to throw an exception.] THROW oExc3 ENDTRY ENDPROC>Hi,