DOC: For Each ... Next Statement Does Not Work for CollectionsLast reviewed: February 4, 1998Article ID: Q180487 |
The information in this article applies to:
SUMMARYIn Books Online, the description for the "For Each ... Next" statement is as follows:
"Repeats a group of statements for each element in an array or collection."However, this is not true for collections because you cannot declare a collection in Microsoft Windows CE Toolkit for Visual Basic 5.0 (VBCE).
MORE INFORMATIONUnlike what's indicated in Books Online, the following code will not work in VBCE because neither the Dim statement's As clause nor New clause are supported:
Private Sub Command1_Click() Dim col As New Collection Dim vnt col.Add "Item1" col.Add "Item2" col.Add "Item3" col.Add "Item4" For Each vnt In col MsgBox vnt Next End Sub Keywords : vb5all vbce kbdocerr Version : WINDOWS:1.0 Platform : WINDOWS Issue type : kbdocerr Solution Type : kbpending |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |