Controlling the Flow of a Procedure
Maintain Data 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 Data 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 Data function.
Alternatively, you can use a different command, such as a BEGIN command defining a block of code, to be conditionally run by the IF command.
- Trigger a task in response to a user action. When users perform an action in a form at run time, the action triggers the task, a function, or URL link, that you have specified.
For more information on the commands listed here, see Command Reference in the App Studio Maintain Data Language Reference manual.