Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array of non-default properties
Message
 
 
À
24/10/2001 14:26:57
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00572626
Message ID:
00572853
Vues:
52
>>>>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() && changed
>   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.

Dragan,

Thanks a lot. I guess, I have to re-write my quick and dirty program, but I'll do it at the next convenient opportunity. I have to concentrate on the project itself now...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform