Purpose : Transfers program control to a labeled location.

Format: GOTO  label

Notes:   label  must be the name of a program label. When a  GOTO  statement is encountered in a script, the script branches to that location. An error occurs if the label does not exist.


# This script will continue to loop until the user
# inputs the correct guess.

# 'BEGIN' is the label at the start of the loop


input guess " Guess a Number Between 1 and 10: "

if guess = 4
print " You are Correct! "

# Transfer program control to the
# location of the label name: "BEGIN".

print "Wrong guess. Try Again."
goto BEGIN

See Also:  LABEL