guides:programming:programmers_reference_manual:conditional_logic

Conditional Logic

Conditional logic commands enable a procedure to test the value of variables or expressions and then branch to appropriate routines.

CommandDescription
Begin Case
Case statement
End Case
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.
If conditional expressionSame as single-line If statement, except that the entire statement is evaluated as an expression, returning only one of two values.
If...Then...Else statementsPerforms 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).
Null statementA no-op. Used if a statement is called for, but no action is desired (example: If … Then Null Else …).
On...GoSub statementBranches, based on an index, to a series of labels to multiple locations. When the subroutine returns, control returns to the statement following this one.
On...GoTo statementBranches, based on an index, to a series of labels to multiple locations.
Until/While statementEstablishes exit conditions for a loop created by the Loop … Repeat or the For…Next statements.
  • guides/programming/programmers_reference_manual/conditional_logic.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1