Try OpenEdge Now
skip to main content
Error Handling
ABL Block Essentials : Block types : Basic blocks
 

Basic blocks

Basic blocks provide fundamental procedural functionality. Although they provide flow-of-control (branching) options, they are not strictly callable units and are, therefore, not routines. The basic blocks are:
*DO
*FOR
*REPEAT
These three blocks have a rich set of options that allow a larger set of basic block variations. Particular variations are often treated as individual blocks in ABL documentation where a variation is important to the current topic. For example, the FOR EACH block is important to batch record processing and the DO TRANSACTION block is important for defining a transaction or subtransaction where ABL would not automatically do so.
Here are some important points about basic blocks:
*Basic blocks have few restrictions on where they can appear in ABL code.
*Flow of control (branching) with basic blocks is handled by references to block labels.
*Only basic blocks can iterate.
*Only basic blocks allow you to alter default error handling with the ON ERROR phrase.
*A DO block without options has no default block properties and is called a simple DO block. Therefore, a DO block does not have default error handling unless it is either a DO TRANSACTION block or a DO ON ERROR block.