Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . Release Notes - <b>new: errorinhandler()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NEW:      ERRORINHANDLER()
------------------------------------------------------------------------------

     ERRORINHANDLER() is a new function that assures a clean and prompt exit
     from within an application.  It produces an "Error recovery failure"
     error and indicates the name of the current module as well as the line
     number.

     Use this function to indicate that an error condition has occurred
     within an error handler.

     The following examples illustrate the use of ERRORINHANDLER().  An
     invalid return value is trapped and reported by the handler:

     oErr:canRetry := .T.
     oErr:canDefault := .T.
     xValue := EVAL(ERRORBLOCK(), oErr)

     // If they request anything other than retry (.T.)
     // or default (.F.), exit with error

     IF VALTYPE(xValue) != "L"
        ERRORINHANDLER()
     ENDIF

     A recursive activation of the error handler has been detected:

     FUNCTION MyErrHandler( oErr )

     STATIC lDejaVu := .F.

        IF (lDejaVu)
           ERRORINHANDLER()
        ENDIF

     lDejaVu := .T.
        <error handling code>
     lDejaVu := .F.

     RETURN


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson