Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Clear memory variables
Message
From
19/12/2001 10:28:29
 
 
To
18/12/2001 18:33:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00595913
Message ID:
00596141
Views:
22
Okay, here is a *very* simplified example. One piece of information that is needed across an application is that data path. Here is a portion of a main program, and a class definition:
* main.prg

oApp = createobject("application")
oApp.dataPath = "g:\mydata"

* do main menu, or do form
* rest of main program here

define class application as custom
    dataPath = ''
enddefine
Now in any procedure or form called below this main program, you can get the data path at any time, by referencing oApp.dataPath.

In practice, an application object can do a lot more for you. For example, When it fires up, you can have it save all of the current environment settings (such as SET TALK, SET DEFAULT), and restore all of those settings in the destroy method.

It would be difficult to fully develop this concept in an online thread...perhaps a book such as Effective Techniques (www.hentzenwerke.com) can help you out. Maybe the topic is covered at http://fox.wikis.com, but I'm not sure...

HTH,

-steve

>Sounds very wise & should work beautifully. I just don't know how to do it. What is: properties of an application object? & how are they created & used?
>Thanks!
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform