* Procedure FillCollection LPARAMETERS oContainerObject LOCAL ix, nMembers, lnExpand, oObjectRef, aContainerObjects[1] nMembers = amembers(aContainerObjects, oContainerObject,2) WITH this FOR ix = 1 to nMembers && Start collecting lnExpand = iif(type(".aCollection[1]")= "L",0,1) DIMENSION .aCollection[alen(.aCollection,1)+lnExpand] oObjectRef = eval("oContainerObject."+aContainerObjects[ix]) .aCollection[alen(.aCollection,1)] = oObjectRef .FillCollection(oObjectRef) && Recurse ENDFOR ENDWITHCustom class has an array property aCollection. You pass it the top level container you want ie:
LPARAMETERS oContainerObject * Just handy at development time IF parameters() = 1 this.FillCollection(oContainerObject) ELSE this.FillCollection(thisform) ENDIF IF type("this.aCollection[1]") = "L" WAIT window nowait "No members" RETURN ENDIF lcOldSafety = set("safety") SET safety off SET textmerge on SET textmerge to ("cobjects.txt") noshow overwrite SET textmerge on FOR each oObjectName in this.aCollection \*************************************************************************************************************************** \* Object : <<sys(1272,oObjectName)>> ( <<sys(1271,oObjectName)>> ) \*-------------------------------------------------------------------------------------------------------------------------- nMembers = amembers(aPEM,oObjectName,1) \* Properties : \*-------------------------------------------------------------------------------------------------------------------------- FOR ix = 1 to nMembers IF aPEM[ix,2]="Property" IF aPEM[ix,1] = "VALUE" ; and pemstatus(oObjectName, "controlsource", 5) ; and type(getpem(oObjectName,"controlsource")) = "G" && Handle general specially IF pemstatus(oObjectName, aPEM[ix,1], 5) ; and !pemstatus(oObjectName, aPEM[ix,1], 2) ; and pemstatus(oObjectName, aPEM[ix,1], 0) \* <<padr(aPEM[ix,1],20," ")>>(General) ENDIF ELSE IF pemstatus(oObjectName, aPEM[ix,1], 5) ; and !pemstatus(oObjectName, aPEM[ix,1], 2) ; and pemstatus(oObjectName, aPEM[ix,1], 0) \* <<padr(aPEM[ix,1],20," ")>> \\ <<getpem(oObjectName,aPEM[ix,1])>> * \\ <<this.typeconvert(getpem(oObjectName,aPEM[ix,1]))>> IF pemstatus(oObjectName,"ReadExpression",5) cExpr = oObjectName.readexpression(aPEM[ix,1]) IF !empty(cExpr) \\ ( <<cExpr>> ) ENDIF ENDIF ENDIF ENDIF ENDIF ENDFOR \* \*-------------------------------------------------------------------------------------------------------------------------- \* Events and methods : \*-------------------------------------------------------------------------------------------------------------------------- FOR ix = 1 to nMembers IF inlist(aPEM[ix,2],"Event","Method") ; and aPEM[ix,1] # "OLE" ; and !pemstatus(oObjectName, aPEM[ix,1], 2) lcEMCode = getpem(oObjectName,aPEM[ix,1]) IF !empty(lcEMCode) \* \* <<aPEM[ix,1]>> \<<lcEMCode>> \* ENDIF ENDIF ENDFOR \*************************************************************************************************************************** \ \ ENDFOR SET textmerge to SET textmerge off SET safety &lcOldSafety this.aCollection=.f. && Release Object References DIMENSION this.aCollection[1] MODI comm ("cobjects.txt")Cetin