Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to remove object
Message
From
29/08/2000 18:14:07
 
 
To
29/08/2000 17:46:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00410511
Message ID:
00410539
Views:
15
>>
>> loObject = THISFORM.oldItem
>> THISFORM.RemoveObject(loObject)
>>
>>When I run this I get 'LOOBJECT not Found' error.
>
>>>Pass the name of the object.
>>>thisform.RemoveObject("olditem")
>
>I tried your syntax (I think I did that once before). Here is the error which appears:
>
> Unknown Member OLDITEM
> METHOD myForm.RemoveObject()
> LINE: 0

Are you sure it's an object? In order to use RemoveObject(), you need to have added the object (not property) using AddObject() to the container; it doesn't work to get rid of properties added via AddProperty(). For example, you can use it to remove a control from the form, but not to remove a form property.


EG:
DEFINE CLASS MyForm AS FORM
   MyProperty = 42
   ADD Object Spin1 AS Spinner

PROCEDURE INIT
   thisform.RemoveObject('Spin1')  && works fine
   thisform.RemoveObject('MyProperty')  && gives your error
ENDPROC
ENDDEFINE
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform