* You don't need utility.arraylib for this for ix = 1 to alen(thisform.aRegisteredObjects,1) if compobj(thisform.aRegisteredObjects[ix],oRegObject) *-- Object is found, therefore we can Re-Register the object values lnRegisteredObjectCounter = ix exit ENDIF endforIf array holding references doesn't belong to a high level (ie:oApp instead of thisform) object you should be carefull with it. Because it would cause dangling object references exist. You could easily avoid it but an easier way IMHO is to store object hierarchy as string rather than directly obj. ref. :
thisform.aObjects[n,1] = ; stuff(sys(1272,toObject), 1, ; at(".",sys(1272,toObject))-1, "thisform") * Calling - could use & too if needed with eval(thisform.aObjects[n,1]) .Left = lnNewLeft ... endwith *vs thisform.aObjects[n,1] = toObjectAlso another side note. Instead of adding code to objects to register them, you could travers your object in a method and register. ie: (Note this code is not optimized for object that are more than 128 level deep in hierarchy)
* form custom method fillcollection lParameters oContainerObject && ie:thisform local ix, nMembers, lnExpand, oObjectRef, aContainerObjects[1] nMembers = amembers(aContainerObjects, oContainerObject,2) for ix = 1 to nMembers && Start collecting lnExpand = iif(type("this.aCollection[1]")= "L",0,1) dimension this.aCollection[alen(this.aCollection,1)+lnExpand] oObjectRef = eval("oContainerObject."+aContainerObjects[ix]) this.aCollection[alen(this.aCollection,1)] = ; stuff(sys(1272,oObjectRef), 1, ; at(".",sys(1272,oObjectRef))-1, "thisform") this.FillCollection(oObjectRef) && Recurse endforCetin