Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modifing classes
Message
De
29/12/1997 12:52:05
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de projet
Divers
Thread ID:
00068012
Message ID:
00068258
Vues:
26
Thanks for the effort. I'm going to try it just because I'm curious about how things work internally, but it's
really not practical.
Example:

I run a form that has 17 different txtBoxes initialized on it. When I quit the form, and want to modify "txtBase",
I can't, because it's in use, but nowhere on the form is there a txtBox named "txtBase", they're all "txtZip",
"txtAddress", "txtPhone", etc. There is no way to determine which one of the 17 is somehow being held in memory
( or all of them ).
The easiest way I found is to just modify "txtShow" ( a sub-class of "txtBase" ), then close it, then I can
modify "txtBase".

Bill





>Bill,
>Issue a CLEAR CLASS myclass_about_to_be_modified
>The point is that VFP keeps classes in memory to speed up operation, you know which one you are about to modify, CLEAR It.
>Or CLEAR ALL but have a look at the CLEAR Command in Help to see what you are clearing.
>HTH
>
>>Unfortunately, since I've closed the form, how do I determine which class is being held in memory.
>>After closing the form, I try to modify a class, but I can't because VFP5.0a thinks it's still in memory
>>(it's not, but VFP doesn't recognize that). In order to get VFP to recognize that there are no classes
>>in memory, I just modify a sub-class of the one I want (any sub-class will do, even one that is not used
>>in the form), close that class, then the original class is available to modify.
>>
>>
>>
>>>Have a look in HELP.
>>>You will find under CLEAR Commands a reference to CLEAR CLASS Classname
>>>Because the Class is held in memory you can not modify it until it is CLEARed
>>>
>>>>>>Frequently after running a form, when I go to the pj to modify one
>>>>>>of the classes used in the form (or the form class itself) I get the
>>>>>>error "cannot modify class in use" (syntax may be wrong). I spent
>>>>>>many hours trying to figure out where it was in use, but then
>>>>>>discovered that I can modify a sub-class of the forbidden class, then
>>>>>>then forbidden class can be modified.
>>>>>>
>>>>>>Example:
>>>>>>
>>>>>>run client.spx
>>>>>>modify class frmBase --- error
>>>>>>modify class frmData --- subclass of frmBase used by client.spx
>>>>>>close frmData
>>>>>>modify class frmBase --- works fine now
>>>>>>
>>>>>>What am I missing?
>>>>>>
>>>>>>TIA
>>>>>
>>>>>Sounds like you have an object based on the class still residing in memory.
>>>>>When I get this error, I issue a 'clear all' in the command window.
>>>>>I have found this clears remaining object and allows me to modify my class.
>>>>>
>>>>>- Chris Holtz
>>>>
>>>>Bill and Chris:
>>>>
>>>>Sometimes even a Clear All doesn't seem to work. In that case, I just close VFP and re-open it. Faster than trying to find what was left open.
>>>>
>>>>Barbara
Bill Morris
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform