Mandy,
Mandy said:
wondering what is the file that is not open where i already close all table?
Well, you don't know what you're causing with a shutdown. There's still all code in Unloads and Destroy potentially running, and in all of that code some file may be addressed, that's not open.
Closing all tables and data is best done after read events AND after all forms closed and all objects are released. That's why I also suggest to let the runtime do this and not a CLOSE DATABASES.
It's not your main problem that a file is NOT open, you wanted to have them all closed.
Regarding what all these things in the RUN command mean, my first idea would be that you don't shutdown the computer. So only replace this with CLEAR EVENTS or QUIT. Depends.
I see no chance telling from what you posted what is still happening and causing errors to pop up in shutdown. But if VFP manages to show a Messagebox, it would also manage to save information into a log file.
So a good time to now at least finally start error handling, something any application should do almost as first step, even when your goal is an error free program.
But first, start logging what happens at critical points. Here's a simple logging function to add to the end of your main.prg:
Function logmessage(tcMessage)
Strtofile(Transform(DateTime)+Program(Program(-1)-1)+tcMessage+chr(13)+chr(10),JUSTPATH(SYS(16,0))+"yourapp.log",1)
If you have that, at any time in any code you can write soemthing like
And instead of something you can also log any value of interest. It'll log the time this happens and which code called the logmessage function. Everything is written into a logfile called "yourapp.log" in the same directory as your EXE, you can easily change that to another location.
I'd put one after READ EVENTS:
Code:
logmessage("ending application")
And one you can put at the start:
Code:
logmessage("starting application")
Then you have a starting point if starting and ending your EXE causes two lines in that logfile.
The connection to error logging then is that an error handler also uses that fucntion to log information about errors.
First see if you get this working, then we can go on.
Chriss