- programmēšana dļa polnih idiotoff
- 2003.06.10, 15:08
- Zero-Based and One-Based Collections
A collection is either zero-based or one-based, depending on what its starting index is. As you might guess, the former means that the index of the first item in the collection is zero, and the latter means it's one. Examples of zero-based collections are the Forms and Controls collections. The Collection object is an example of a one-based collection.
Older collections in Visual Basic are more likely to be zero-based, while more recent additions are more likely to be one-based. One-based collections are somewhat more intuitive to use, because the index ranges from one to Count, where Count is the property that returns the number of items in a collection.
The index of a zero-based collection, by contrast, ranges from zero to one less than the Count property.
(no MSDN)
un jā, vai es tev jau teicu, ka tu esi idiots? - 2 rakstair doma