FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Changing Errorsys
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Changing Errorsys
Posted: Fri Feb 16, 2007 08:04 PM

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,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Changing Errorsys
Posted: Fri Feb 16, 2007 10:31 PM

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

Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Changing Errorsys
Posted: Fri Feb 16, 2007 11:55 PM

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,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Changing Errorsys
Posted: Sat Feb 17, 2007 12:09 PM
Unrecoverable errors are the ones with

oErr:Severity = ES_CATASTROPHIC //3


This is a sample of error trapping:

#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
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Changing Errorsys
Posted: Wed Feb 21, 2007 06:09 PM

Thanks a lot, Enrico. I'll take a good look.

Best regards,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB

Continue the discussion