Microsoft KB Archive/137443

= Size and Nesting Level Limitations of Classes =

Article ID: 137443

Article Last Modified on 12/13/1999

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q137443



SUMMARY
Visual FoxPro 3.0 allows you to subclass any of the base classes provided by Visual FoxPro. When subclassing, you are free to add your own properties and methods to the predefined properties and methods for a base class. This article explains some of the considerations in defining and using classes.



MORE INFORMATION
In general, there are no limits to the size of a class definition. Theoretically, a class is capable of having four billion members (properties and methods). However, every member definition does use a small amount of memory. The amount of memory depends on the member name and member value.

Class nesting levels are limited by the following two factors:


 * File handles: For each class that is subclassed, the file that contains the class definition must be opened. It is possible to combine class definitions in class files (.vcx or .prg files) to avoid running into this limitation.
 * Stack space: When creating instances of objects that are either subclassed or contain objects that are subclassed, Visual FoxPro recursively reads in class definitions for subclasses. This can lead to an "Insufficient Stack Space" situation.

NOTE: As a general rule, well-designed applications should usually have no more than five or six levels of subclassing.

Additional query words: VFoxWin

Keywords: KB137443

-

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

© Microsoft Corporation. All rights reserved.