Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I use a modeless form?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00501150
Message ID:
00501186
Vues:
27
>>>>>>>>>>>
>I guess you see why I am looking for a framework. the idea or concept of an application class is a new one for me today. ! mY gut feeling when I did some tests was that that public var before I created a class, was going about things, just badly.
>
>BYW, do you have a pointer or link to what you call an appliation class? so I can get at least the idea...
>>>>>>>>>>>

You probably have (or had) a prg full of utility functions, right? You can still SET PROCEDURE TO utility.prg , nothing really wrong with that. A more OOP way is to create a class, non-visual, maybe based in Custom. Add methods and properties to it as needed. Each of your old utility functions would be a method. The properties allow your class to maintain state. So you could create a method to save the TALK state, or DELETED, or the current ALIAS, or all of the above.

Try the following:
Make a class (custom) to save ALIAS. In Init() you save current alias to a property. In Destroy() you return ALIAS to the one saved in the property.

Then you do:
LOCAL loSaveAlias
loSaveAlias = CreateObject("SaveAlias")
SELECT MyNewAlias
* do some processing
RETURN
Note that you do not require to remember to go back to the previous ALIAS before RETURNing. When it goes out of scope, it triggers the Destroy() that will reset your ALIAS (same would work for SET DELETED ON|OFF, etc.)

Here you have an example of a utility class that you put in your utilities.VCX and you use throughtout your app.

HTH


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform