User Tools

Site Tools

Navigation:  Language Reference > 12 - Execution Control > Execution Control Statements >====== GOTO (go to a label) ====== Previous pageReturn to chapter overviewNext page


GOTO target


GOTO Unconditionally transfers program control to another statement.
target The label of another executable statement within the PROGRAM, PROCEDURE, or ROUTINE.

The GOTO statement unconditionally transfers control from one statement to another. The target of a GOTO must not be the label of a ROUTINE or PROCEDURE.

The scope of GOTO is limited to the currently executing ROUTINE or PROCEDURE–it may not target a label outside the ROUTINE or PROCEDURE in which it is used.

Extensive use of GOTO is generally not considered good structured programming practice. LOOP is usually considered a better alternative.


ComputeIt PROCEDURE(Level)


IF Level = 0

GOTO PassCompute                     !Skip rate calculation if no Level


Rate = Level * MarkUp                 !Compute Rate

RETURN(Rate)                          !and return it

PassCompute RETURN(999999)             !Return bogus number

See Also:


goto_go_to_a_label_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)