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.