Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Release object from within
Message
 
 
To
27/10/2006 06:25:56
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01164936
Message ID:
01164971
Views:
7
Tibor,

To add to Gary's post. If the button click looks like this:
oX = createobject(...)
ox.DoTheTask()
The reference held by oX will not let the object actually self destruct.

Also calling an event like Destroy() only causes any overridden code you've written in that method to be executed. It does not cause the native destroy behavior to execute. Events are notifications that something has happened or is about to happen.

>In VFP 7 I create an object in a form button's click event. The object has various methods. Its main method calls the other methods for processing. If an error occurs, the object's error event needs to release the object. But Release THIS, THIS.Destroy() do not work, although they do trigger--when these events are completed execution is returned to the line of code right after the line that caused the error. The object can't seem to get out of its own way, so to speak. I even tried creating an Assign property in the form that triggered the object's release when the property value changed due to an error inside the object--still the same results. Please help.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform