Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing objects explicitly
Message
From
13/08/2000 10:56:38
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00404342
Message ID:
00404381
Views:
10
RELEASE is probably a good idea if you're in the habit of declaring (shudder) PUBLIC variables. Why? Because they won't go away until VFP is quit or a CLEAR ALL is used.

As to SELECT before ENDSCAN....yeah, I still have that habit myself.


>I, like many people, have certain habits I get into which are hard to break. (For instance, I insist on placing a SELECT statement immediately before an ENDSCAN, even though objectively I know it will happen implicitly.)
>
>One such habit involves releasing objects. When I create an object by issuing the commands:
> LOCAL loMyObject
> loMyObject = CREATEOBJECT(...)
>I will typically, at the end of the method/procedure, issue:
> RELEASE loMyObject
>
>I do so because I have a vague memory of having left a dangling object reference once by failing to explicitly release an object. My question is, is there a time when the RELEASE statement is actually required? If there is not such a situation, is it better programming practice (that's a judgment call, I know) to issue the RELEASE command or not to?
>
>Thanks!
>zahid
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform