Can you think of any reason why after I close an instance of a window (as described below) it doesn’t test as equal to Nil?
// window2 is a global property declared as an instance of window1
// window1.implicitinstance = false
// in some other window in the application I want to open an instance of window1
window2 = New window1
window2.show
// when done using window2 the user clicks on the close button
// later in the code I want to see of an instance of window1 is already open so I check
If window2 = Nil then ...
// I am sure that there are no other window2's open - but this test (= Nil) fails. And when I go further to access controls on window2 (because it fails = Nil) some of the controls on window2 ARE nil (as if they were closed).
What you could do is use a function to figure out if the Windows that are open match a window you are looking for. If it doesn’t match then you know that window is not open.
Function CheckWindow as Boolean
Dim n as Integer = WindowCount
for i as integer = 0 to n-1
if Window(i) isa <YourWindow> then
Return True
Exit
Else
end if
next
[quote=163128:@Bob Keeney]If ImplicitInstance is set to true (it is by default) then referring to the Window will, in fact, instantiate it.
I have implicitinstance = false for window1 (the master version of the window). I think I tried to reference this property in code but the compiler didn’t like it (I could be remembering that wrong). Nevertheless - wouldn’t that property be reflected in instances of the master version?