Purpose
Jumps to a different spot (in the same procedure), identified by a label.
Restrictions
You cannot issue a Goto statement through the MapBasic window.
Syntax
Goto label
label is a label appearing elsewhere in the same procedure.
Description
The Goto statement performs an unconditional jump. Program execution continues at the statement line identified by the label. The label itself should be followed by a colon; however, the label name should appear in the Goto statement without the colon.
Generally speaking, the Goto statement should not be used to exit a loop prematurely. The Exit Do statement and Exit For statement provide the ability to exit a loop. Similarly, you should not use a Goto statement to jump into the body of a loop.
A Goto statement may only jump to a label within the same procedure.
Example
Goto endproc
...
endproc: End Program
See Also:
Do Case...End Case statement, Do...Loop statement, For...Next statement, OnError statement, Resume statement