To branch unconditionally out of the normal program sequence to a specified line number or label.
GOTO
location
location is the line number or label at which execution is to continue.
Early versions of BASIC did not have DO…LOOP, ELSE clauses for IF statements, or SELECT CASE statements. They used GOTO
to implement these constructs. To improve your programs’ readability and simplify debugging, the general recommendation is to restrict the use of GOTO
.
i = 0
Start:
PRINT "i ="; i
INPUT "Again"; reply$
IF reply$="N" THEN
END
ELSE
i = i + 1
END IF
GOTO Start