GOTO
(Statement)
Unconditionally branch a program.
{GOTO|GO TO}<labelname>
This statement unconditionally transfers control to a label specified by <labelname> and continues execution there.
GO TO can be used instead of GOTO.
DIM li1 As Integer
|
|
IF li1 = 0 THEN
|
'If li1 is 0
|
STOP
|
'Stop program execution
|
ELSEIF li1 = 1 THEN
|
'If li1 is 1
|
GOTO *samp1
|
'Jump to the label *samp1
|
GO TO *samp2
|
'Jump to the label *samp2
|
ELSEIF li1 = 2 THEN
|
'If li1 is 2
|
GOSUB *samp3
|
'Call the subroutine beginning with the label name *samp3
|
ELSE
|
'If li1 is any other value
|
RETURN
|
'Return to the caller program
|
END IF
|
'Declare the end of the IF statement
|