Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting a FXP
Message
De
03/01/2018 15:56:34
 
 
À
03/01/2018 12:16:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01656909
Message ID:
01656917
Vues:
58
>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)

*-- do your stuff
ret = .f.
release rewt
* clear ?
ERASE (THIS.Filename)
*** Error occurs here because Object was still in memory and might have been asked to "step" in coverage (or debugger), "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?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform