The program below generates code to demonstrate 1000 levels of inheritance of VFP objects. The code looks like this:
DEFINE CLASS c1 as c2
DEFINE CLASS c2 as c3
DEFINE CLASS c3 as c4
That means class “c1” is a subclass of class “c2”, etc. On my machine, 1000 levels of inheritance run almost instantaneously. Try adding more levels and you’ll run into some limitations.
If you change the baseclass to be a Form, then you’ll run into a GDI limit on the number of windows created. On my machine the RegisterDragDrop call fails. I don’t get an error dialog, because there are too many windows already created!
SET TEXTMERGE ON TO temp.prg noshow
\FOR j = 1 TO NUM
FOR i = 1 TO NLEV
\DEFINE CLASS c<<i>> as c<<i+1>>
\DEFINE CLASS c<<NLEV+1>> as custom
\ PROCEDURE Foobar(p1)
SET TEXTMERGE to
MODIFY COMMAND temp nowait