User Tools

Site Tools


finally_exception_handling_clean_up_.htm
Navigation:  »No topics above this level«====== FINALLY(exception handling clean up) ====== Return to chapter overview

NewCNet.jpg

FINALLY

statements

FINALLY Clean up exception handling
statements Any valid language statement

blk2blue.jpg

FINALLY is used to clean up any exception handling initiated by TRY.

If there is no exception inside the TRY section, control directly transfers to the FINALLY statement. Statements following FINALLY are always executed. If an exception is encountered, statements following any CATCH structure will be processed prior to FINALLY.

NoteBox.jpg

It is not recommended to transfer control out of a FINALLY section using BREAK, RETURN or GOTO.

Example:

CODE

TRY

 F()  !calling a function

CATCH (Exception e)

  MESSAGE('Exception in code: ' & e.Message)

FINALLY

  !Any cleanup code here

END

See Also: CATCH (trap exception)

THROW (signal an exception)

TRY (arm exception handling)

finally_exception_handling_clean_up_.htm.txt · Last modified: 2021/04/15 12:48 by 127.0.0.1