Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting a FXP
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01656909
Message ID:
01656916
Views:
58
Once again, thanks, but still no go. My TRY/CATCH still reports that the code is in use, and can not erase the FPX.
I have arrived at a means, but it is kind of dirty. I am erasing all the FPX in the Temp folder. If any leftover, they are removed.

>
>
>CLEAR CLASS classname
>CLEAR PROGRAM && I forgot to..., but the code is from 2007
>
>
>ERASE (THIS.Filename)
>
>
>MartinaJ
>
>>Nop, still there.
>>
>>Perhaps there is a better way then creating PRG to generate the object in the PRG code? I have looked at ExecStr(), but it likes to return a .NULL. instead of the object.
>>
>>>Hi Greg,
>>>
>>>
>>>
>>>CLEAR CLASS classname
>>>
>>>ERASE (THIS.Filename)
>>>
>>>
>>>
>>>MartinaJ
>>>
>>>>I'm back with another question.
>>>>
>>>>I am creating a PRG file dynamically, that contains a Class definition.
>>>>
>>>>
>>>>lcAll "define class ..."
>>>>THIS.Filename = ADDBS(SYS(2023))+CFG_PREFIX+SYS(3)+".prg"
>>>>
>>>>STRTOFILE(lcAll,THIS.Filename,0)
>>>>ret = NEWOBJECT(THIS.Section, THIS.Filename)
>>>>
>>>>ERASE (THIS.Filename)
>>>>*** Error occurs here, "File cannot be closed because outstanding references exist."
>>>>ERASE (forceext( THIS.Filename, "fxp") )
>>>>
>>>>
>>>>I am creating optimized classes, and have difficulty on the clean up procedure.
>>>>
>>>>I create a temporary PRG containing a DEFINE CLASS block. At the top of PRG is a RETURN CREATEOBJECT(...) statement. When the PRG is called the object is returned. The temporary PRG is deleted, but the FXP is still in use. How to close before ERASE.
>>>>
>>>>The object finished being initiated. I believed that NewObject() opened the library, created the object, then closed the library. Therefore bypassing the SET PROCEDURE call. The FXP should be freed, ya. But until a CLEAR ALL seems to be issued, the file is locked by VFP.
>>>>
>>>>Any suggestion?
Greg Reichert
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform