479 ObjectPAL: eventInfo.setErrorCode()VERSIONS: All (?) - written for Paradox 5
SUBJECT: eventInfo.setErrorCode()
BY: MARK PAUKER
Date: 16 November 1995
If you want to trigger a critical error, use fail(). Still, this will only cause the error method to be called if you are not nested inside of any try/onFail blocks or inside of any built-in methods. If you are nested within a try/onFail, it will simply send you to the nearest onFail, and if you are inside of a built-in it will send you back to the method that called the built-in and return False. (You can also use errorLog() to place a warning error on the stack but that will have the same restrictions as using fail(), _plus_ the error won't be sent to the error method until after the method terminates, and then only if it hasn't subsequently been cleared by some other RTL method.)
The setErrorCode method is used to tell Paradox not to do the built-in's default behavior (and to cancel the current event chain). This will cause the built-in to return False (and may set a warning error upon return to the calling method depending on the error code used), but will not trigger the built-in error method.