GOTO

Continue the command execution at a specific line within a batchfile.

Syntax

GOTO label

Parameters

label

A label is a sequence of alphanumeric characters followed by a colon “:”. The first character must be an alphabetic character. For example: LABEL:

Description

This command is used within batchfiles. It causes the command execution to continue at the specified line marked with label. This command must not be used in interactive mode. Forwarding references to currently undefined labels are permitted, but labels cannot be referenced from outside of the batch file where they are defined.

Example

! Example batch file goto.xdb
  
SET VALUE @COUNT = 1
  
! Go to label LA1 --> line 15
GOTO LA1
  
LA3:
! If condition true go to label LA2 --> line 19 == The End!
IF @COUNT <= 0 THEN GOTO LA2 END
PRINT "Start\n"
SET BREAKPOINT AT main
RUN
PRINT "End\n"
SET VALUE @COUNT = @COUNT - 1
  
LA1:
! Go to label LA3 --> line 6
GOTO LA3
  
LA2:

See Also

For more complete information about compiler optimizations, see our Optimization Notice.