Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Big 'O'
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00115108
Message ID:
00115298
Vues:
14
PMFJI, but I've been following this thread and wonder if you or any other contributers to the thread can answer this question for me. Aside from it being more OOP, what are the benefits/advantages of having an application object with properties and methods compared to a main.prg with variables and procedures?

>An "Application Object" is simply an object that is global and provides services and information to the entire application. For example, in The Visual FoxPro Codebook, the application object has a forms collection, a FoxTools wrapper class and functionality to read/write from the registry (among other things). Typically, an application object will also have the code to startup the application and shut it down. So, in effect, an application's start program would look something like this:
>
>
>*-- TestMain.Prg
>*--
>*-- A Hypothetical main program
>
>SET TALK OFF
>SET CLASSLIB TO MyClassLib
>PUBLIC goAPP
>goAPP=CreateObject("APPLICATIONOBJECT")
>goAPP.Start()
>
>*-- The read events is somewhere in the code run or called by Start (). So, all we have to do is shut down at this point
>
>*-- Do whatever you want after the application has everything closed
>
>
>Please take this as illustrative, not definitive. Just to give the idea.
>
>HTH
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform