Reversible Blocks

not yet finished

Among the many misunderstood features of Omnis is the concept of the Reversible Block. This feature is misunderstood, misused, or completely avoided partly because no good explanation is given in the manual set that comes with Omnis and the few examples that use them are not designed to concisely show how they work. Hopefully this brief explanation will help.

Let's begin with the concept of a "block" command. This is a command that affects a "block" (group of contiguous lines) of code. Omnis has a number of block commands. The "If...End if" command combination is generically known as a "conditional block". That is, the block of code between those two lines is only executed if the specified condition is met. The "Repeat...Until" command combination delineates a "repetitive block" of code -- one that is repeated until a specified condition is met. In a similar way, the block of code between the "Begin reversible block" and "End reversible block" commands is affected by being bounded by these two command lines. It is the effect that is truly interesting -- not to mention powerful.

Now let's consider the concept of "states of the application".

The State Stack

What the commands really mean

Why this is powerful

More than one allowed in the same procedure, but not nested. Nesting of reversible blocks occurs at the subroutine levels.