Conditional logic commands enable a procedure to test the value of variables or expressions and then branch to appropriate routines.
Command | Description |
Tests a series of conditions (cases). When any one is met, the statements dependent on that condition are executed. All subsequent condition tests (cases) are skipped. | |
Same as single-line If statement, except that the entire statement is evaluated as an expression, returning 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). | |
A no-op. Used if a statement is called for, but no action is desired (example: If ... Then Null Else ...). | |
Branches, based on an index, to a series of labels to multiple locations. When the subroutine returns, control returns to the statement following this one. | |
Branches, based on an index, to a series of labels to multiple locations. | |
Establishes exit conditions for a loop created by the Loop ... Repeat or the For...Next statements. |