Next: 10.7.3 Labels (LABEL) Up: 10.7 Branching (IF/ELSEIF/ENDIF) Previous: 10.7.1 IF statements


10.7.2 GOTO commands

GOTO commands can be used to skip over parts of the input. The general form is

GOTO,command,[n],[nrep]

Program control skips to the $\vert n\vert$'th occurrence of command (Default: $n=1$). command must be a keyword in the first field of an input line. If n is positive, the search is forward starting from the current position. If n is negative, search starts from the top of the input. The GOTO command is executed at most nrep times. The default for nrep is 1 if $n \lt 0$ and infinity otherwise. We recommend that GOTO commands are never used to construct loops.

Alternatively, one can jump to labels using

GOTO,label

Since labels must be unique, the search starts always from the top of the input. It is required that the label ends with a colon.



molpro@molpro.net
Oct 10, 2007