bm160 Multibranch Control Structure

Program Control


 

bm160 heading of the multibranch structure

  bm178 branching term

  bm179 one branch for commands (can be used several times)

          bm180 one testing term (can be used several times)

  bm181 commands for branches not found

 

The multibranch control structure is used for branching a program into several parts depending on the term value. As a branching term any type of term can be utilized: a number, a flag, a text etc. Based on the branching term the program decides which command branch will be used. In the body of the branching structure one or more branches of commands may be used. The branches are searched from the top to the bottom. In each branch one or more testing term may be quoted (of the same type as the branching term). The terms are evaluated gradually from the top to the bottom. If a term is found which is identical with the branching term, the commands contained in the branch are executed, and the program continues running behind the end of the multibranch structure. If none of the terms corresponds to the branching term, the program continues in the following command branch. If no branch with a corresponding term is found, the commands for branches not found are executed.

 

Example of using:

 

bm182