Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dereferencing/releasing an object
Message
From
27/11/2001 17:04:30
 
 
To
27/11/2001 13:43:58
Spencer Redfield
Managed Healthcare Northwest, Inc.
Portland, Oregon, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00586488
Message ID:
00586673
Views:
19
For starters, you might want to be more precise in your use of the terminology. I found your question a bit difficult to follow.

>I have a form method with a local object, loParameters, created as custom. It has several properties and another custom object, loParameters.SearchOptions.

I'm assuming that you have a form (call it MyForm), in which there is a property called loParameters that holds a custom object. This object in turn has a property called SearchOptions, which holds another custom object. So, you have MyForm, Myform.loParameters, and MyForm.loParameters.SearchOptions.

If I'm not describing things correctly, stop me now and correct me...

>I pass object loParameters to a modal form. In the modal form's INIT event the parameter object is stored to a form property object and in the modal form's UNLOAD event this form property object is returned to the calling method.

I'll be honest - I stopped using DO FORM (which is what this implies) a long time ago. NewObject() is much more suited to my base classes.

So, you're using the form as a pseudo-function, with the statement:
DO FORM MyModalForm WITH loParameters TO loParameters
I don't think you need the TO clause, as objects are passed by reference. This means that whatever you did to MyForm.loParameters will be reflected in MyForm.loParameters when MyModalForm is released.

>Questions:
>
>1) Am I mistaken in my thinking that I should be able to RELEASE or assign .NULL. to object loParameters.SearchOptions?

Do you need to? See my second answer...

>2) Is "RELEASE loParemeters" or "loParameters = .NULL." sufficient to fully free up object loParameters.SearchOptions?

I'm assuming at this point that MyForm.loParameters.SearchOptions is being used to transport values in its properties. Assuming that nothing else has a reference to it, you should be able to just get by with a RELEASE statement. It may be that using that TO clause in the DO FORM statement could be the source of the problem - try eliminating that.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform