>>>OK. Just put any type of cotainer (container, grid, pageframe etc) with a textbox in it and try.
>>>Cetin
>>
>>BTW I'm not talking about selected objects. Try w/o selecting from form level.
>>Cetin
>
>No, no :) This is a SIMPLE FormBuilder for simple forms without pageframes and grids :)
First, traversing is simple - look at "Drilling Down to Objects" Thread #
570451 Message #
571238.
Second, you don't need the array at all. Simply, in metacode, inside the loop where you traverse properties:
if pemstatus()
vProperty=getpem(oOldObject, lcProperty)
oNewObject.WriteExpression(lcProperty,vProperty)
endif
The exception is the .name, of course, which would have to be replaced once the old object is discarded. The methods can be handled similarly (readmethod, writemethod) but you'd need VFP7 to add a method if it doesn't exist already. There was a very neat trick about adding a method in VFP6, but doesn't exactly work each time - addproperty(cMethodName), writemethod(cMethodName, cMethodContent), and then save the whole thing. Next time you open it for editing, it's a method with the code in it. In VFP7, there's an addition in syntax, writemethod(cMethodName, cMethodContent,
lAddIfNew), and you can add methods to
anything with it.
The other thing you may have problems with, if you're adding and destroying objects on the fly (as I propose), is that the objects[] collection will dynamically get populated and depopulated, so you'd better have a copy of the references in an array - and keep in mind that this array needs to be declared local, because the recursion would be a mess without it.