Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object in form tests T for existance then error
Message
From
22/03/2006 17:34:16
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Novell 5.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01106772
Message ID:
01106821
Views:
28
>I am encountering one of the oddest things I have encountered in VFP.
>
>I have a primary form, in which various container classes are brought back and forth into existence, but always with the same object name, "oMainPane."
>
>In my code, I am testing for the existence of the object. If the object exists, it is deleted, and then recreated using the new desired class:
>
>
>IF PEMSTATUS(THISFORM, 'oMainPane', 5)
>   THISFORM.REMOVEOBJECT('oMainPane')
>ENDIF
>THISFORM.AddObject('oMainPane', 'Trans')
>
>
>However, although the code is passing the test for existence of the oMainPane object, when it hits the call to REMOVEOBJECT, the code fails, citing "Unknown member OMAINPANE."
>
>I have put other code in there, and verified that the oMainPane object WAS there, I almost want to question whether the REMOVEOBJECT is somehow occurring more than once, but this is pure speculation ... I don't know how else this could happen.
>
>Can anyone offer suggestions?

It is a vfp bug.

When you execute a RemoveObject(),
VFP leave a zombi object ( the property part ).
if TYPE("THISFORM.oMainPane.BASECLASS")=="C"
    THISFORM.REMOVEOBJECT('oMainPane')
ENDIF
...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform