guides:programming:programmers_reference_manual:program_control

Program Control

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.

StatementDescription
Call statementBranches to an external subroutine.
Case statementProvides 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.
Debug statementInvokes the debugger.
End statementTerminates a Then or Else condition.
Function()Similar to the "call @" syntax for subroutines, the Function syntax allows a function to be called whose name is indeterminate at compile time.
GoSub statementBranches to an internal subroutine.
GoTo statementBranches unconditionally to another portion of the procedure.
If condition expressionSame as single line If statement, except that the entire statement is evaluated as an expression, leaving only one of two values.
If...Then statementPerforms 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).
Loop statementMarks the beginning of a group of statements, where the group is to be executed repeatedly, until the test expression is satisfied.
Null statementUsed if a statement is called for, but no action is desired (example: If … Then Null Else …).
On...GoSub statementBranches to local subroutines. When the subroutine is terminated, control returns to the statement following this one.
On...GoTo statementBranches to one of several statement labels.
Return statementBranches 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.
  • guides/programming/programmers_reference_manual/program_control.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1