Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RemoveObject Doesn't
Message
From
06/11/2006 17:23:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01167475
Message ID:
01167503
Views:
7
>I have the following code. When run subsequently, it errors on the AddObject line
>because the cntProperty container is not being removed. It dissappears from the screen
>but the object reference still exists:
>
>
>	.RemoveObject('cntProperty')
>
>	** Determine which property container to add
>	DO CASE
>
>		CASE ThisForm.cClassType='E' AND ThisForm.cCategory= 'R'
>			cClassName = 'cntProperty_RE'
>
>		CASE ThisForm.cClassType='E'
>			cClassName = 'cntProperty_E'
>
>		CASE ThisForm.cClassType='L'
>			cClassName = 'cntProperty_L'
>
>		CASE ThisForm.cClassType='M'
>			cClassName = 'cntProperty_M'
>
>		CASE ThisForm.cClassType='P'
>			cClassName = 'cntProperty_P'
>
>		CASE ThisForm.cClassType='S'
>			cClassName = 'cntProperty_S'
>
>		CASE ThisForm.cClassType='C' AND ThisForm.cCardType = 'S'
>			cClassName = 'cntProperty_B'
>
>		CASE ThisForm.cClassType='C'
>			cClassName = 'cntProperty_C'
>
>	ENDCASE
>
>	** Add the new property container
>	.AddObject('cntProperty', cClassName)
>
>
You cannot completely remove an object defined at the class level - it will go .null., but the reference will still be there. You need to add the object at runtime, then it can be removed.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform