FINALLY(exception handling clean up)

Top 

 

FINALLY

statements

 

 

FINALLY

Clean up exception handling

statements

Any valid language statement

 

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.

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)