Message
From
12/04/2000 08:26:43
 
 
To
11/04/2000 16:40:51
Fabian Valencia
Calamos Asset Managment Inc.
Naperville, Illinois, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00358343
Message ID:
00358595
Views:
13
AFAIK, there is no way of removing a property other than recreating the object. This lead me to ask you why do you need such functionality? Is it for memory reason? Other reason?
>I have this type of situation going on in a program right now :
>
>o=CREATEOBJECT('MyObject')
>o.AddProperty( 'nVar1', 10 )
>o.AddProperty( 'cVar3', 'Hello' )
>lResult = o.MyMethod()
>
>o=CREATEOBJECT('MyObject')
>o.AddProperty( 'nVar1', 25 )
>o.AddProperty( 'cVar2', 'Good Bye' )
>lResult = o.MyMethod()
>
>For performance reasons, I don't like performing the CREATEOBJECT line over and over, but I don't know any other way to remove all the added properties.
>
>In the second call to o.MyMethod, the property cVar3 must not exist anymore.
>
>Seems like a RemoveProperty method would work, if i only had one.
>
>Does anyone have any ideas, on how to get this object back to it original state without having to recreate it?
Previous
Next
Reply
Map
View