Controlling a the Flow of a Procedure
Maintain provides many different
ways of controlling the flow of execution within a procedure. You
can:
- Nest a
block of code. In commands in which you can nest another command,
such as in an IF command, you can nest an entire block of commands
in place of a single one by defining the block using the BEGIN command.
- Loop through
a block of code a set number of times, while a condition remains
true, or until it becomes true, using the REPEAT command.
- Branch unconditionally to
a block of code called a Maintain function. You define the function
using the CASE command, and can invoke it in a variety of ways. When
the function terminates, it returns control to the command following
function invocation.
Alternatively, you can branch to a function,
but not return upon termination, by invoking the function using
the GOTO command.
- Branch conditionally using
the IF command. If the expression you specify in the IF command
is true, the command executes a PERFORM or GOTO command nested in
the THEN phrase, which branches to a Maintain function.
Alternatively,
you can nest a different command, such as a BEGIN command defining
a block of code, to be conditionally run by the IF command.
- Trigger an
event handler in response to user events. When users perform the
event in a form at run time, the event triggers the event handler,
a function or URL link, that you have specified. Event handlers
are described in Forms and Event-driven Processing, and in Defining Events and Event Handlers in the Developing
WebFOCUS Maintain Applications manual.
For more information on the commands listed here, see Command Reference in the Maintain Language
Reference manual.