Microsoft KB Archive/265750

= DOC: For Each ... Next Statement Does Not Work for Collections =

Article ID: 265750

Article Last Modified on 9/4/2002

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q265750



SUMMARY
In the Help topics for eMbedded Visual Basic 3.0 (eVB), the description for the '''For Each ... Next''' statement is as follows:

&quot;For Each...Next

This statement repeats a block of statements for each element in an array or collection.&quot;

However, this is not true for collections because you cannot declare a collection in eVB.



MORE INFORMATION
Unlike the information presented in the eVB online help, the following code does not work in eVB because the New clause is not supported: Private Sub Command1_Click Dim col As New Collection Dim vnt col.Add &quot;Item1&quot; col.Add &quot;Item2&quot; col.Add &quot;Item3&quot; col.Add &quot;Item4&quot; For Each vnt In col MsgBox vnt Next End Sub Running this code generates the following compile error message:

The new keyword is not supported for Windows CE.

Additional query words: WinCE

Keywords: kbbug kbnofix kbdocerr KB265750

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.