Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The Big 'O'
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00115108
Message ID:
00115271
Views:
15
>Object, that is. :)
>
>At VFP class, the instructor told us that it's a good idea to make the whole application into an object. He did it using the application wizard. I tried that, but kept running into problems. I'd rather do it myself, anyway. I don't like wizards because I like to know what all the code in my app means. The best way for me to figure something out is to do it myself.
>
>So, could someone give me some pointers about how I go about making an application object and what to do with it when I got one?
>
>Do I still do a "read events"? Where do I put it if I do?
>
>Basically, I need the steps to turn a collection of forms into a runnable application.
>
>Easy question, right?
>
>Thanks,

Michelle,

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
Menachem Bazian, CPA
President
BC Consulting Services, Inc.
973-773-7276
Menachem@BazianCentral.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform