I am looking for way to supress the C5 error messagebox.
I have a non visual utility program that runs briefly, does a small task and then shuts down.
Occasionally, maybe every 1000 or so executions I get a C5 error.
I will keep on looking to try and resolve the error, however I want to supress the error message box. In fact I want to supress any error message box.
Can this be done?
I am using a standard ON ERROR error handler that directs the error to file
MAIN.PRG
MAIN.PRG
With regards
Alastair
I have a non visual utility program that runs briefly, does a small task and then shuts down.
Occasionally, maybe every 1000 or so executions I get a C5 error.
I will keep on looking to try and resolve the error, however I want to supress the error message box. In fact I want to supress any error message box.
Can this be done?
I am using a standard ON ERROR error handler that directs the error to file
MAIN.PRG
Code:
PARAMETERS payloadFile, testmode2
&&& MAIN.PRG &&&
ON ERROR DO ErrorHandler WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO(1)
MAIN.PRG
Code:
********************
PROCEDURE ErrorHandler
********************
PARAMETER tnError, tcMessage, tcMessage1, tcProgram, tnLineno
LOCAL lcErrorMessage
lcErrorMessage = "Date : " + TTOC(DATETIME(),3) + CHR(13) + CHR(10) ;
+ "Error number: " + TRANSFORM(tnError) + CHR(13) + CHR(10) ;
+ "Error message: " + tcMessage + CHR(13) + CHR(10) ;
+ "Line of code: " + tcMessage1 + CHR(13) + CHR(10);
+ "Program: " + tcProgram + CHR(13) + CHR(10);
+ "Line number: " + TRANSFORM(tnLineno)
lcDirectory=_screen.clientpath
lcLine = CHR(13) + CHR(10) + '*************************************************'
lcFinalText = lcLine + CHR(13)+ CHR(10) + lcErrorMessage + CHR(13) + CHR(10)
IF DIRECTORY(_screen.clientpath)
SET SAFETY OFF
IF FILE(_screen.clientpath + 'ERRORLOG.TXT')
lctext = FILETOSTR(_screen.clientpath + 'ERRORLOG.TXT')
IF LEN(lctext > 10000000)
STRTOFILE(lcFinalText , _screen.clientpath + 'ERRORLOG.TXT',0)
ELSE
STRTOFILE(lcFinalText , _screen.clientpath + 'ERRORLOG.TXT',1)
ENDIF
ELSE
STRTOFILE(lcFinalText , _screen.clientpath + 'ERRORLOG.TXT',0)
ENDIF
SET SAFETY ON
ENDIF
SET DEFAULT TO (_screen.clientpath)
CLEAR EVENTS
ENDPROC
With regards
Alastair