Although execution of a procedure generally proceeds from top to bottom, procedure control statements enable you to channel a procedure's execution to different sections, to subroutines, or to the debugger. Program control statements can also halt execution of a procedure.
Statement | Description |
Branches to an external subroutine. | |
Provides a framework for conditional branching. Evaluates one or more test expressions, then executes the relevant code at the corresponding internal subroutine label. A Case statement must be introduced with Begin Case and terminated with End Case. | |
Invokes the debugger. | |
Terminates a Then or Else condition. | |
Similar to the "call @" syntax for subroutines, the Function syntax allows a function to be called whose name is indeterminate at compile time. | |
Branches to an internal subroutine. | |
Branches unconditionally to another portion of the procedure. | |
Same as single line If statement, except that the entire statement is evaluated as an expression, leaving only one of two values. | |
Performs single-line or multiple-line logic. If not single-line, statements for both branches must be delimited with End. Multi-line conditional logic syntax is applicable to all conditional statements (such as Read or Locate statements). | |
Marks the beginning of a group of statements, where the group is to be executed repeatedly, until the test expression is satisfied. | |
Used if a statement is called for, but no action is desired (example: If ... Then Null Else ...). | |
Branches to local subroutines. When the subroutine is terminated, control returns to the statement following this one. | |
Branches to one of several statement labels. | |
Branches back to the statement following the calling statement. If used from a function, Return can pass a value back to the calling stored procedure or event handler. |