Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== 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. ^Statement^Description^ |[[call|Call statement]]|Branches to an external subroutine.| |[[case|Case statement]]|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.| |[[debug|Debug statement]]|Invokes the debugger.| |[[end|End statement]]|Terminates a Then or Else condition.| |[[function_function|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|GoSub statement]]|Branches to an internal subroutine.| |[[goto|GoTo statement]]|Branches unconditionally to another portion of the procedure.| |[[if_conditional_expression|If condition expression]]|Same as single line If statement, except that the entire statement is evaluated as an expression, leaving only one of two values.| |[[if|If...Then statement]]|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).| |[[loop|Loop statement]]|Marks the beginning of a group of statements, where the group is to be executed repeatedly, until the test expression is satisfied.| |[[null|Null statement]]|Used if a statement is called for, but no action is desired (example: If ... Then Null Else ...).| |[[on...gosub|On...GoSub statement]]|Branches to local subroutines. When the subroutine is terminated, control returns to the statement following this one.| |[[on...goto|On...GoTo statement]]|Branches to one of several statement labels.| |[[return|Return statement]]|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.| guides/programming/programmers_reference_manual/program_control.txt Last modified: 2024/06/19 20:20by 127.0.0.1