Chapter 11 Flow Control Statements
11-21
11.5 Unconditional Branch
GOTO (Statement) [Conforms to SLIM]
Function
Unconditionally branches a program.
Format
{GOTO|GO TO}<Label name>
Explanation
This statement jumps to the label designated by <Label name> and continues
execution there.
GO TO can be used instead of GOTO.
Related Terms
GOSUB
Example
DIM li1 As Integer
IF li1 = 0 THEN 'When li1 is 0.
STOP 'Stops the execution of the program.
ELSEIF li1 = 1 THEN 'When li1 is 1.
GOTO *samp1 'Jumps to the label of *samp1.
GO TO *samp2 'Jumps to the label of *samp2.
ELSEIF li1 = 2 THEN 'When li1 is 2.
GOSUB *samp3 'Calls the subroutine of the label name*samp3.
ELSE 'When li1 is another value.
RETURN 'Returns to the calling program.
END IF 'Declares the end to the IF statement.
Comments to this Manuals