This prevents losing important error info in a situation where different errors occur in quick succession before you have a chance to debug the first errors in the sequence. Especially important where a customer fails to tell you about an earlier error before they crash the app with something else.
Here it is, to be added just above existing Errsysw.prg comment,
"// Generates a file with an Error Log "
- Code: Select all Expand view RUN
// If an Error.log already exists, add it to bottom of cErrorLog.
// Added this to retain prior error messages up to limit of 25k...
IF FILE("Error.log")
cText := MEMOREAD("Error.log")
cText := CRLF+CRLF+REPLICATE("*",50)+ ;
CRLF+REPLICATE("*",50)+CRLF+CRLF+cText
IF LEN(cText) < 50000
cErrorLog += cText
ELSE
cErrorLog += SUBSTR(cText,1,5000)
ENDIF
ENDIF
// Generates a file with an Error Log
BEGIN SEQUENCE // [ continue with existing PRG code... ]
- Roger