I am not sure I understand what you are asking. It is my impression that the line "return obj.RetVal" will do just what you need.
It will get the value from RetVal (before destroying the object.) Then it will destroy the object and then it will pass back the value to the calling program.
>I know you can do something like
>do form to myvariable
>
>Is there a similar way to get a variable from the object as it is released?
>
>obj=createobject("objtomake")
> then when the object is released some variable is set.
>i.e.
>in the release event
>return obj.RetVal would place the value of obj.retval someplace
>
>TIA,
>Mike
Hector Correa