This issue has caught me out a few times before I cottoned on. To illustrate, if I have the following code that instantiates a new window and saves a reference to it
mDownloadWindow = New DownloadWindow //mDownloadWindow is a property and DownloadWindow has Implicit Instance set to Off
After mDownloadWindow has done something then is closed, I would have assumed that mDownloadWindow would now = Nil, but it doesn’t.
So if I have code to check that the window is still open before trying to manipulate it, I’ve been using
If mDownloadWindow <> Nil Then
'do something only if mDownloadWindow is still open
End If
But I discovered that this doesn’t work as mDownloadWindow <> Nil even after being closed. To make it work, I have to remember to put mDownloadWindow = Nil in the close event. This workaround is fine, but I’m sure I will forget to put it in at some stage and it will trip me up again. Is there a better way to check if a window or container control is still open?
Thanks,
Frank