>>>When I use 'ON SHUTDOWN DO CloseProg' (where 'CloseProg' is a procedure in the main
>>>program) in an .EXE - VFP5.0, my error handler returns 'closeprog.prg cannot be found'. It
>>>appears as though the ON SHUTDOWN command destroys the environment and memory
>>>variables before executing the DO CloseProg. The problem does not exist in the interactive mode.
>>>Why?
>>
>>Hi Lawrence,
>>The easiest solution is:
>>ON SHUTDOWN do MyProcedure IN MyProgram
>
>Hi Glenn,
>I had tried that clause which did not solve the problem at the time. But I had subsequently
>cleaned up some code. Your suggestion prompted me to re-test that exit path and it now works
>even without the 'IN' clause.
Your syntax should look like this:
OH SHUTDOWN DO CloseProg()
the parenthesis are required so that fox knows your talking about a function and
not a seperate program. Why the behavior is different in the two modes is unknown to me! ;)