finally

Typekeyword
DictionaryLCS
LibraryLiveCode Script
Syntax
finally
Summary

Used within a try control structure to contain statements that are executed whether or not there was an error.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
finally
RelatedKeyword: else
Glossary: keyword, statement, variable, error, execute, control structure
Control Structure: pass, exit, try
Description

Use the finally keyword to designate one or more statements that are to be executed within a try control structure.

The finally keyword appears on a line by itself, and is followed by a list of statements. The statements in the finally section are executed whether or not there was an error while executing the try control structure.

The finally section is always executed even if the try control structure contains an exit or pass statement, so it can be used for final cleanup actions such as deleting variables.

The finally section is optional in a try control structure.