Changing Errorsys

Changing Errorsys

Postby Kleyber » Fri Feb 16, 2007 8: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
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: Changing Errorsys

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Enrico Maria Giordano » Sat Feb 17, 2007 12:09 pm

Unrecoverable errors are the ones with

Code: Select all  Expand view
oErr:Severity = ES_CATASTROPHIC //3


This is a sample of error trapping:

Code: Select all  Expand view
#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
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Kleyber » Wed Feb 21, 2007 6:09 pm

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

Best regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 45 guests

cron