FINALLY Blocks
- Last Updated: October 18, 2024
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
A FINALLY block can be referred to as an end block because
it defines end-of-block processing for the block that encloses it. End blocks are always
part of another block and that block is called the associated block. The
other type of end block is the CATCH block which is discussed in
CATCH Blocks.
The purpose of a FINALLY block is to hold
cleanup code that must execute regardless of what else executed in the associated block.
The FINALLY block may include code to delete dynamic
objects, write to logs, close outputs, and other routine, but necessary, tasks. A
FINALLY block runs on each iteration of a block,
even if the iteration results in an ERROR or STOP condition.