Using For Each to Loop Through Arrays Is Not Recommended (129931)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q129931 SUMMARY
The For Each statement can be used on variant type arrays and collections
that contain generic object, variant, or OLE automation variables.
You can also use the For Each statement with an array that is not a variant
type, but the result is a substantial decrease in performance. This article
shows by example how to use the For Each statement to loop through
collections and demonstrates the decrease in performance that occurs when
you use the For Each statement to loop through arrays.
Modification Type: | Major | Last Reviewed: | 12/9/2003 |
---|
Keywords: | kbcode KB129931 |
---|
|