</head> <body> <h1>Until <span class="ver">[AHK_L 59+]</span></h1> <p>Applies a condition to the continuation of a Loop or For-loop.</p> <pre class="Syntax"> <span class="func">Loop</span> { ... } <span class="func">Until</span> <i>Expression</i> </pre> <h2 id="Parameters">Parâmetros</h2> <dl> <dt>Expression</dt> <dd><p>Any valid <a href="../Variables.htm#Expressions">expression</a>.</p></dd> </dl> <h2 id="Remarks">Remarks</h2> <p>The expression is evaluated once after each iteration, and is evaluated even if <a href="Continue.htm">continue</a> was used. If the expression evaluates to false (which is an empty string or the number 0), the loop continues; otherwise, the loop is broken and execution continues at the line following <i>Until</i>.</p> <p>Loop Until is shorthand for the following:</p> <pre>Loop { ... if (<i>Expression</i>) break }</pre> <p>However, Loop Until is often easier to understand and unlike the above, can be used with a single-line action. Por exemplo:</p> <pre>Loop x *= 2 Until x &gt; y</pre> <p><i>Until</i> can be used with any Loop or For. Por exemplo:</p> <pre>Loop, Read, %A_ScriptFullPath% lines .= A_LoopReadLine . "`n" Until A_Index=5 <em>; Read the first five lines.</em> MsgBox % lines </pre> <p>If <a href="../Variables.htm#Index">A_Index</a> is used in <i>Expression</i>, it contains the index of the iteration which has just finished.</p> <h2 id="Related">Tópicos relacionados</h2> <p><a href="Loop.htm">Loop</a>, <a href="While.htm">While-loop</a>, <a href="For.htm">For-loop</a>, <a href="Break.htm">Break</a>, <a href="Continue.htm">Continue</a>, <a href="Block.htm">Blocks</a>, <a href="LoopFile.htm">Files-and-folders loop</a>, <a href="LoopReg.htm">Registry loop</a>, <a href="LoopReadFile.htm">File-reading loop</a>, <a href="LoopParse.htm">Parsing loop</a>, <a href="IfExpression.htm">If (expression)</a></p> </body> </html>