</head> <body> <h1>Goto</h1> <p>Jumps to the specified label and continues execution.</p> <pre class="Syntax"><span class="func">Goto</span>, Label</pre> <h2 id="Parameters">Parameters</h2> <dl> <dt>Label</dt> <dd><p>The name of the <a href="../misc/Labels.htm">label</a> to which to jump.</p></dd> </dl> <h2 id="Remarks">Remarks</h2> <p>When using a dynamic label such as %MyLabel%, an error dialog will be displayed if the label does not exist. To avoid this, call <a href="IsLabel.htm">IsLabel()</a> beforehand. For example:</p> <pre>if IsLabel(VarContainingLabelName) Goto %VarContainingLabelName%</pre> <p>The use of Goto is discouraged because it generally makes scripts less readable and harder to maintain. Consider using <a href="Else.htm">Else</a>, <a href="Block.htm">Blocks</a>, <a href="Break.htm">Break</a>, and <a href="Continue.htm">Continue</a> as substitutes for Goto.</p> <h2 id="Related">Related</h2> <p><a href="Gosub.htm">Gosub</a>, <a href="Return.htm">Return</a>, <a href="IsLabel.htm">IsLabel()</a>, <a href="Else.htm">Else</a>, <a href="Block.htm">Blocks</a>, <a href="Break.htm">Break</a>, <a href="Continue.htm">Continue</a>, <a href="../Variables.htm#ThisLabel">A_ThisLabel</a></p> <h2 id="Examples">Examples</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> Jumps to the label named "MyLabel" and continues execution.</p> <pre>Goto, MyLabel <em>; ...</em> MyLabel: Sleep, 100 <em>; ...</em></pre> </div> </body> </html>