General information
Category:
Object Oriented Programming
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only