General information
Category:
Coding, syntax & commands
Title:
Re: Application Object
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only