Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing All Files Opened with FOpen
Message
From
26/11/2001 14:58:30
 
 
To
26/11/2001 11:38:55
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00584535
Message ID:
00585934
Views:
30
> One question: Am I correct in assuming that if I set oGuard = .NULL.
> rather than issue return it should also close the appropriate file?

Yes, setting the variable to .NULL. will kill the object and thus trigger its DESTROY method which closes the file. This also works if the guard object is part of another object and the containing object is destroyed.

The code in my post was just a minimalistic example, though. There are several enhancements that make it more practical, like a method that releases the handle from the guardian's care - in case you want to suspend the death sentence for the handle ;-) - or an _ASSIGN method for the handle that closes the currently stored handle before stuffing the new value in.

Have fun!
Previous
Reply
Map
View

Click here to load this message in the networking platform