Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing property of Class
Message
De
09/09/2001 15:18:43
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
À
09/09/2001 09:25:00
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00554263
Message ID:
00554456
Vues:
7
>>>I have tried that, not bad, but I want to find some "nicer" way.
>>
>>I think a "Factory Class/Object" is about as close as you can get, while still keeping things "tidy".
>
>Another way would be to have the class compiled in a .prg file, and have the .prg file built on the fly, and recompiled in the next run. Thus the process would go like this:
>- have the class definition in a .prg
>- have something instantiated from a subclass of that class
>- a method changes properties of the object, and then employs some combination of parser/generator to write a new .prg which would write a different version of the original .prg; this should be feasible because it's only .fxp that is kept open while an instance lives.
>- once all the instances of this class are released, compile the .prg (the fresh version).
>- ready for next run.
>
>The trick, of course, is in the parser/generator. The trouble it would take to write it is not worth it. If my zemljak volunteers to write it, I figure he'll have lot of fun doing it and less hair when he's done.

The parser/generator could be trivial ... one can "walk" an object in memory and generate a new Class definition that way.

But, since we're all still guessing as to the "why and what", ...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform