7.1.12 GoTo
- Purpose
-
Unconditionally jumps to a specified label.
- Syntax
GoTo LabelName
- Argument
-
- LabelName
-
Specify the label name of the jump destination. Use a name that complies with the variable naming conventions.
- Description
-
The GoTo statement transfers execution control to a specified label. Execution resumes from the line following the label. A syntax error occurs if multiple labels have the same name at the script level or procedure level.
You can write the label at any position. However, if you specify a GoTo statement within a procedure, the labeled line must exist within that procedure.
An execution error occurs if you specify a jump destination label as follows:
-
Specify a GoTo statement outside the procedure and specify a jump destination label within the procedure.
-
Specify a GoTo statement outside the flow control statement and specify a jump destination label within the flow control statement.
-
- Example
If Exec ("NOTEPAD.EXE" ,True ,"Loging.txt" ) = False Then GoTo ErrorExit ' Transfer control to ErrorExit. End : ErrorExit: ' Start processing from here. :
- JP1/Script version
-
Supported from JP1/Script 05-00.