Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re: Application Object
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Re: Application Object
Miscellaneous
Thread ID:
00755742
Message ID:
00755742
Views:
27
I have been attempting to write an Application Object which sets up the environment (set commands needed), set up the error handler and shutdown procedures, set up temp folder location, open Database and launch the main menu ...etc. The advantage would be to have self contained code whose class can be dropped in a project and most of the App foundation is created upon instantiating the App object in the main program leaving it lean.

The problem is when activating the 'shutdown' process, I get always an error ' THIS can only be used within a method'

In the 'init' method of the AppMgr class, I have: 'on shutdown do this.release'.

Its release method looks like:
*******
WAIT WINDOW 'Shutting Down...' TIMEOUT .5
CLEAR ALL
RELEASE ALL
HIDE WINDOW all
CLEAR EVENTS
********

The line containing 'read events' is where the program crashes when I step through the code. I placed that line in both the main.prg and the 'init' method of the class with no sucess in both cases.

I use VFP 7.0 SP1.

Any theories as to why this error takes place?

Many thanks.
Next
Reply
Map
View

Click here to load this message in the networking platform