O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enumerators

It’s convenient to use arrays or—as you will see later, collections—to save data, but you must also be able to access the data easily. With indexers, .NET Framework offers you the simplest option to access individual values: using an object variable, you provide an index value or a variable that represents an index. By changing the variable that serves as an index, you can programmatically specify which array element you want to process. What you get are typical counter loops for iterating through the array elements, such as the following:

For count As Integer = 0 To Array.Length - 1
    DoSomethingWith(Array(count))
Next

Note

Enumerators have nothing to do with Enums. Only the names are similar. Enums are listed/enumerated names of certain ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required