Array of windows

I couldn’t find any reference to this subject so I’m sorry if it’s been covered before.
I have and I’d like to be able to use it for a couple of things and apparently I can’t do exactly what I want.
The property is called ObjSpawn type window and isn’t currently an array. I set ObjSpawn = MainList which is a window.
Apparently, I can’t test this:

ObjSpawn.name = MainList.name

since it doesn’t show in autocomplete. I also cannot test this:

If ObjSpawn = MainList Then

since it doesn’t go into the code that follows.
If I can find out to test this I could make an array of open windows.
How do I do this?
Maybe I should have used byref since I might be making a copy?

why not use what Xojo already gives you?

For i As Integer = 0 To WindowCount - 1
  Dim w As Window = Window(i)
  If w <> Nil Then
  /// do somethng with this window or its properties
  End If
Next

Does this work for you?

if ObjSpawn isa MainList then ...

It works. Thanks. Grammar.

This might not work. I want to be able to open some windows without any order as it usually doesn’t matter.
What I am also after is cutting back on things like menuitems. Alot of them are specific to various windows and can’t be copied.
Referring to specific window objects would be helpful.

They both work. Thank you. I finally found the window() under the function window.

Actually, for this instance, I need the NOT version of ISA. Does it exist?

Not in a nice readable format, but this is what I use:

if not (Object isa DifferentObject) then

Thanks.
How does one find in the debugger the array of windows?
I can find Windows and it shows 2 or is that it?

[quote=333554:@Arthur Gabhart]It works. Thanks. Grammar.

This might not work. I want to be able to open some windows without any order as it usually doesn’t matter.
What I am also after is cutting back on things like menuitems. Alot of them are specific to various windows and can’t be copied.
Referring to specific window objects would be helpful.[/quote]

create a different menubar for each window…
and what do you mean “cannot be copied”… do not put the “code” in the menu handler… put a call to a global method, and let the various windows share that instead.

Thanks Dave. That’s what I meant.