ON ERROR do sysErrMess WITH ; ERROR(), MESSAGE(), MESSAGE( 1), PROGRAM(), LINENO()then the error routine is like:
* Program sysERRMESS * Display Message Box dialog of the error details, given by params #INCLUDE Standard.H LPARAMETERS tcError, tcMess, tcMess1, tcProg, tnlineNo LOCAL lcLine1, lcLine2, lcLine3, lcLine4, lcLine5 Store "" To lcLine1, lcLine2, lcLine3, lcLine4, lcLine5 lcLine1 = 'Error number: ' + ALLTRIM( STR( tcError)) + CHR(13) lcLine2 = 'Message: ' + ALLTRIM( tcMess) + CHR(13) lcLine3 = 'occurred at Line No: ' + ALLTRIM( STR( tnlineNo)) + CHR(13) lcLine4 = 'of Program: ' + PROPER( ALLTRIM( tcProg)) + CHR(13) lcLine5 = 'Line of Code: ' + ALLTRIM( tcMess1) + "." + CHR(13) + CHR(13) lcLine6 = 'Please note down details and report error.' = MESSAGEBOX( lcLine1 + lcLine2 + lcLine3 + lcLine4 + lcLine5 + lcLine6, MB_ICONSTOP, "System Program Error")HTH