<script type="text/javascript">$(function(){0<=window.navigator.userAgent.toLowerCase().indexOf("ucbrowser")&&CaoNiMaDeUc()})</script> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1632085368384154" crossorigin="anonymous"></script><script src="https://autohotkey.top/gtag.js"></script></head> <body> <h1>枚举器对象 <span class="ver">[AHK_L 49+]</span></h1> <p>允许枚举容器中的项目.</p> <div class="methodShort"> <h2 id="Next">Next</h2> <p>检索枚举中的下一个或多个项目.</p> <pre class="Syntax">Boolean := Enum.<span class="func">Next</span>(OutputVar1 <span class="optional">, OutputVar2, ...</span>)</pre> <h3 id="Parameters">参数</h3> <dl> <dt>OutputVar1, OutputVar2</dt> <dd>接收实现中的具体的值.</dd> <dt>...</dt> <dd>附加参数, 如果支持.</dd> </dl> <h3 id="Return_Value">返回值</h3> <p>成功时该方法返回 1(true), 或者没有项目剩余时则返回 0(false).</p> <h3 id="Object">对象</h3> <p>由 <a href="Object.htm#NewEnum">ObjNewEnum()</a> 返回的枚举器对每个键值对只调用一次, 最多允许两个参数:</p> <ul> <li>OutputVar1: 键值对中的<b>键</b>.</li> <li>OutputVar2: 接收与 <i>OutputVar1</i> 关联的<b>值</b>.</li> </ul> <p>键值对以实现定义的顺序返回. 即, 它们通常不会以赋值的顺序返回. 现有的键值对可以在枚举时修改, 但插入或移除键可能使得一些项目被多次枚举或一次都不枚举.</p> <h3 id="Related">相关</h3> <a href="../commands/For.htm">For 循环</a>, <a href="Object.htm#NewEnum">Object._NewEnum()</a> <h3 id="Examples">示例</h3> <pre class="NoIndent"><em>; 创建一些样本数据.</em> obj := Object("red", 0xFF0000, "blue", 0x0000FF, "green", 0x00FF00) <em>; 进行枚举!</em> enum := obj._NewEnum() While enum[k, v] t .= k "=" v "`n" MsgBox % t <em>; 需要 <span class="ver">[AHK_L 59+]</span></em> For k, v in obj s .= k "=" v "`n" MsgBox % s </pre> </div> <a href="https://dftg.net">dftg</a></body> </html>