VERSIONS: All versions
SUBJECT: Best way to shut down an application
BY: RICHARD FAIRHURST
Date: 9 March 1999
I found the majority of the answer to how to exit the application and leave the desktop clean of the master form from Mike Irwin in a thread
on the objectPAL newsgroup that was back in June 1998. Since I am using a script to open my main form per Russ Carmichael's advice, I just
altered the script to wait on the main form and then issue the exit command when the form closes itself. That was the technique that must have
been used by the other user I mentioned since his application launched through a script.
So correct me if I'm wrong, but it seems like the very simple script below does the basics of Russ's approach and then shuts down Paradox
when the form is done:
method run(var eventInfo Event)
var
f form
stDatadir string
endvar
stDatadir = workingdir() + "\\DataDir"
addProjectAlias("DataDir", "Standard", stDatadir)
f.open("APPMast")
f.wait()
exit()
endMethod
For some reason, the MenuWindowCloseAll command is disabled by the wait statement and so as far as I can tell all other forms must be
explicitely closed during the running of the application to clear the desktop of any non-dialog box forms.