</head> <body> <h1>Enumerator Object <span class="ver">[AHK_L 49+]</span></h1> <p>Allows items in a collection to be enumerated.</p> <h2 id="toc">Sumário</h2> <ul class="indent"> <li><a href="#Methods">Methods</a>: <ul> <li><a href="#Next">Next</a>: Retrieves the next item or items in an enumeration.</li> </ul> </li> </ul> <h2 id="Methods">Métodos</h2> <div class="methodShort"> <h3 id="Next">Next</h3> <p>Retrieves the next item or items in an enumeration.</p> <pre class="Syntax">Boolean := Enum.<span class="func">Next</span>(OutputVar1 <span class="optional">, OutputVar2, ...</span>)</pre> <dl> <dt>OutputVar1, OutputVar2</dt> <dd>Receives an implementation-specific value.</dd> <dt>...</dt> <dd>Additional parameters, if supported.</dd> </dl> <p>This method returns 1 (true) if successful or 0 (false) if there were no items remaining.</p> <p>Enumerators returned by <a href="Object.htm#NewEnum">ObjNewEnum()</a> are called once for each key-value pair, and allow up to two parameters:</p> <ul> <li>OutputVar1: Receives the <b>key</b> in a key-value pair.</li> <li>OutputVar2: Receives the <b>value</b> associated with <i>OutputVar1</i>.</li> </ul> <p>Key-value pairs are returned in an implementation-defined order. That is, they are typically not returned in the same order that they were assigned. Existing key-value pairs may be modified during enumeration, but inserting or removing keys may cause some items to be enumerated multiple times or not at all.</p> <p>Assuntos relacionados: <a href="For.htm">For-loop</a>, <a href="Object.htm#NewEnum">Object._NewEnum()</a></p> <p>Examples:</p> <pre class="NoIndent"><em>; Create some sample data.</em> obj := Object("red", 0xFF0000, "blue", 0x0000FF, "green", 0x00FF00) <em>; Enumerate!</em> enum := obj._NewEnum() While enum[k, v] t .= k "=" v "`n" MsgBox % t <em>; Requires <span class="ver">[AHK_L 59+]</span></em> For k, v in obj s .= k "=" v "`n" MsgBox % s </pre> </div> </body> </html>