Script GOTO Statement

GOTO @label

The GOTO statement is used to direct script processing to a line that is not directly after the current line of a script.

GOTO is similar to GOSUB except that there is no option to RETURN.

For example:

IF (_var1 = "FIRST") GOTO @LABEL1
ECHO "Value of var1 is not FIRST."
EXIT

@LABEL1
ECHO "Value of var1 is FIRST"
EXIT

outputs only one of the above ECHOed lines, depending on the value of _var1.

Copyright © 2017 American Chemical Society. All Rights Reserved.