Changing Errorsys

Post Reply
User avatar
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Changing Errorsys

Post 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,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Changing Errorsys

Post 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
User avatar
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Post 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,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post 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
User avatar
Kleyber
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Post by Kleyber »

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

Best regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
Post Reply