Until - Syntax & Usage - AutoHotkey

文章推薦指數: 80 %
投票人數:10人

The Until statement applies a condition to the continuation of a Loop or For-loop. Until[AHK_L59+] AppliesaconditiontothecontinuationofaLooporFor-loop. Loop{ ... }UntilExpression Parameters Expression Anyvalidexpression. Remarks Theexpressionisevaluatedonceaftereachiteration,andisevaluatedevenifcontinuewasused.Iftheexpressionevaluatestofalse(whichisanemptystringorthenumber0),theloopcontinues;otherwise,theloopisbrokenandexecutioncontinuesatthelinefollowingUntil. LoopUntilisshorthandforthefollowing: Loop{ ... if(Expression) break } However,LoopUntilisofteneasiertounderstandandunliketheabove,canbeusedwithasingle-lineaction.Forexample: Loop x*=2 Untilx>y UntilcanbeusedwithanyLooporFor.Forexample: Loop,Read,%A_ScriptFullPath% lines.=A_LoopReadLine."`n" UntilA_Index=5;Readthefirstfivelines. MsgBox%lines IfA_IndexisusedinExpression,itcontainstheindexoftheiterationwhichhasjustfinished. Related Loop,While-loop,For-loop,Break,Continue,Blocks,Files-and-foldersloop,Registryloop,File-readingloop,Parsingloop,If(expression)



請為這篇文章評分?