Branching affects the normal execution sequence by transferring control to a labeled statement in the same scoping unit. The transfer statement is called the branch statement, while the statement to which the transfer is made is called the branch target statement.
Any executable statement can be a branch target statement, except for the following:
Certain restrictions apply to the following statements:
Statement | Restriction |
---|---|
DO terminal statement | The branch must be taken from within its nonblock DO construct[1]. |
END DO | The branch must be taken from within its block DO construct. |
END IF | The branch should be taken from within its IF construct[2]. |
END SELECT | The branch must be taken from within its CASE construct. |
[1] If the terminal statement is shared by more than one
nonblock DO construct, the branch can only be taken from within the
innermost DO construct
|
The following branch statements are described in this section: