BeforeRenameView

Count

This is a property of each of the OLE collections that are part of VFP. In each case, it tells you how many objects are in that collection.

Usage

nCount = colCollection.Count
Chalk one up for polymorphism. VFP's native collections, like Forms and Controls, each have their own corresponding count property with a distinct name, such as FormCount and ControlCount. The WhateverCount property belongs to the same object that owns the collection. For example, forms have a Controls collection and a ControlCount property.

But the developers got smarter. The new OLE collections, like Projects and Objects, own their own count and they all use the same name for it.

Of course, we don't need the count for a collection as much as we used to because FOR EACH lets us loop through all the members without worrying about how many there are.

Example

* How many projects are open? ? Application.Projects.Count

See Also

Files, For Each, Objects, Projects, Servers


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net