>>>Can anyone offer suggestions?
>>
>>It is a vfp bug.
>>
>>When you execute a RemoveObject(),
>>VFP leave a zombi object ( the property part ).
>
>Wow.
>
>This is not fun.
>
>You know what? I saw a checkbox that remained behind after one object had been removed and the rest of the form was empty! I thought it was a glitch with the video driver. But it retained the last value from the form. Maybe this is the same thing? Memory is not being reclaimed properly?
>
Difficult to say.
RemoveObject() it certainly removes some structures.
Try Thisform.Draw or ThisForm.Cls at the end of the operation,
this can syncronize the buffer video.
I believe that in the most greater part of the cases
the guilt is in VFP's routines
>How to determine zombi from live object?
TYPE("ZOMBI.BASECLASS")=="C"
> I am using addobject() and removeobject() as the core of program functionality.
You can use this, but only with pure add/remove methods.
You cannot use a class's object component, as ADD OBJECT or VCX's record.
Example:
CLEAR
PUBLIC f1,f2
f1=CREATEOBJECT("f1")
f1.show
f1.move(400,0)
f2=CREATEOBJECT("f2")
f2.move(400,300)
f2.show
DEFINE CLASS f1 as Form
caption = "click on form"
ADD OBJECT zombi as checkbox
PROCEDURE Click
form::removeobject("zombi")
ACTIVATE screen
? "zombi",this.controlcount at 20,VARTYPE(this.zombi),TYPE("this.zombi.baseclass")
ENDDEFINE
DEFINE CLASS f2 as Form
caption = "click on form"
PROCEDURE Init
form::addobject("nozombi","checkbox")
this.nozombi.visible = .t.
PROCEDURE Click
form::removeobject("nozombi")
ACTIVATE screen
? "no zombi",this.controlcount at 20,VARTYPE(this.nozombi),TYPE("this.nozombi.baseclass")
ENDDEFINE