Page 1 of 1
Changing Errorsys
Posted: Fri Feb 16, 2007 8:04 pm
by Kleyber
Hi all,
Has anyone changed the errorsys in order to quit the program only if we pulse the button QUIT? My idea is if we pulse other button, the program continues normally without quit. Is it possible? If so, how can I do it in my errorsys?
Best Regards,
Re: Changing Errorsys
Posted: Fri Feb 16, 2007 10:31 pm
by Enrico Maria Giordano
It's only possible for recoverable errors. You can BREAK if you want let the main program to handle the error, return .T. to retry the operation or return .F. to ignore the error.
EMG
Posted: Fri Feb 16, 2007 11:55 pm
by Kleyber
Hi Enrico,
Thanks (as always) for your answer. I was looking at a program made in Delphi where all the errors are showed, but the user can ignore them and come back to the program. Which cases are non recoverable errors? Do you have an example to show it?
best regards,
Posted: Sat Feb 17, 2007 12:09 pm
by Enrico Maria Giordano
Unrecoverable errors are the ones with
Code: Select all
oErr:Severity = ES_CATASTROPHIC //3
This is a sample of error trapping:
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL nVar, oErr
ERRORBLOCK( { | oErr | Break( oErr ) } )
BEGIN SEQUENCE
nVar *= 2
RECOVER USING oErr
? "oErr:Description", oErr:Description
? "oErr:CanDefault", oErr:CanDefault
? "oErr:CanRetry", oErr:CanRetry
? "oErr:CanSubstitute", oErr:CanSubstitute
? "oErr:Severity", oErr:Severity
END SEQUENCE
RETURN NIL
EMG
Posted: Wed Feb 21, 2007 6:09 pm
by Kleyber
Thanks a lot, Enrico. I'll take a good look.
Best regards,