>Hi!
>
>This code is in a .PRG file. In my application, (APPLICATION.EXE), I execute this function within a key label. Sure, I compile it before with the command [COMPILE *.PRG]. Why I cannot delete the .FXP file after I ran this .PRG?
>
>I used to do it with function without DEFINE CLASS so I never got this problem.
> Do you have an idea?
>
>Thanks
>
The .fxp is the class library for your object. You can't delete it as long as there's an object reference to any object based on that class, or any other class defined in that .fxp file. Fox does keep them open, and trying to delete it while it's in use, if it was allowed in the first place, would be something like cutting the branch you're sitting on.
There are several ways to avoid this - one would be to keep the class definition in a separate file, either prg/fxp or a vcx, or to check for the existence of any of the objects based on this class before trying to delete the .fxp.