GOTO Statement
warning | The GOTO statement cannot be used in batch files. |
GOTO, label
The GOTO statement is used to transfer program control to the point in the program specified by the label. An example of the GOTO statement is:
GOTO, JUMP1
statements . . .
.
.
.
JUMP1: X = 2000 + Y
In the above example, the statement at label JUMP1 is executed after the GOTO statement, skipping intermediate statements. The label may also occur before the reference of the GOTO to that label.
note | Be careful in programming with GOTO statements. It is easy to get into a loop that will never terminate if no escape (or test) is within the statements spanned by the GOTO (and sometimes even when there is). |
GOTO statements are frequently subjects of IF statements:
IF A NE G THEN GOTO, MISTAKE
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.