Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Catégorie:
Codage, syntaxe et commandes
> 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!
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement