errorparam can be either a text message or a two-element sequence in which the first is a text message and the second is an error code (integer).
If any user-defined clean up routine have been attached, they are invoked prior to win32lib's own cleanup routine, then the application is aborted. See attachCleanUp() for details.
Example:
abortErr( {"The tape drive is not responding.", w32MsgNum + 17} )abortErr( "Fatal error. Bummer, dude." )
See Also: attachCleanUp, detachCleanUp, setWarning, warnErr
Allows the application to clean up when win32lib application is ending or detects an abort situation. It is possible to attach multiple clean up routines. If this is done, they are invoked by win32lib in order of most-recently-attached to first-attached, that is in reverse order that they were attached in.
The clean up routine, when invoked by win32lib, is passed four parameters...
The clean up routine must return an integer flag. If the flag is -1, then no further attached clean up routines will be invoked before win32lib aborts, otherwise any other routines will be invoked. You only return -1 if you really do know what the side-effects will be.
The clean up routines are run before the crash_routines the program may have defined if using Euphoria v2.5 or higher.
Example:
function AppCleanUp(integer ErrCode, sequence ErrText, integer ControlId, integer LastCleanUp) . . . return 0 -- Continue with other clean up routines. end function-- Link in my clean-up routine cnt = attachCleanUp( routine_id("AppCleanUp" ))
See Also: abortErr, detachCleanUp, setWarning, warnErr
Example:
integer cnt, CU_id . . . function AppCleanUp(integer ErrCode, sequence ErrText, integer ControlId, integer LastCleanUp) . . . return 0 -- Continue with other clean up routines. end function-- Link in my clean-up routine CU_id = routine_id("AppCleanUp" ) cnt = attachCleanUp( CU_id ) . . . cnt = detachCleanUp( CU_id )
See Also: abortErr, attachCleanUp, setWarning, warnErr
Since 'warning' messages (triggered by warnErr) are only warnings and not fatal, it may be advantageous to suppress them in an application.
The flag maybe one of ...
By default, the setting is 1 Example:
-- suppress warning messages setWarning( 0 )
See Also: abortErr, attachCleanUp, detachCleanUp, warnErr
errorparam can be either a text message or a two-element sequence in which the first is a text message and the second is an error code (integer).
This routine will display a dialog window with three buttons.
[ YES ] : If selected, the program will continue.
[ NO ] : if pressed, the program will continue, but future warning about the same
error will be ignored.
[CANCEL]: if pressed, will stop the program running immediately.
If any user-defined clean up routine have been attached, they are invoked prior to win32lib's own cleanup routine, if the application is aborted. See attachCleanUp() for details. Example:
warnErr( "Bad data. Abort program?" )
See Also: abortErr, attachCleanUp, detachCleanUp, setWarning