Goto

Top  Previous  Next

This dollar command will cause transfer of compilation focus to the line starting with an internal label specified through $Label and then continue compilation from there skipping all lines in between.  It is employed using the syntax

 

$goto internallabel

Notes:

This dollar command can be used to skip over or repeat sections of the input files.
In Batinclude files, the target labels or label arguments can be passed as parameters.
When using a $goto statement GAMS protects against the potential of an infinite loop. The number of times a program jumps back to a label is counted and when a limit is reached, GAMS will issue an error. A maximum of 100 jumps to the same label is the limit.
Further discussion appears in the Conditional Compilation chapter.