Find unused windows in project

The windows in our projects have all the prefix “Win…”.
Any ideas how to find all unused windows easily?

Search for each Window and if you only see one entry in the results list, it’s not used…

I change the window name and compile:
if no error, then that window is unused.

[quote=344681:@Emile Schwarz]I change the window name and compile:
if no error, then that window is unused.[/quote]
This works. But (always a but, no?), if you have platform specific windows you’ll have to do a compile or remote debug for each target platform. Thank thing goes with methods, properties, etc that might have target ‘include in’ attributes.

As I have about 500 windows in my project I hoped there might be an easy (not so time-consuming) way to find unused windows :-/.
Thanks shao and Emile for you suggestions. Searching also has always been my method to find unused windows.

Save it as XML,
write a program to read that XML and extract all the Window Names
then do a 2nd pass to find how many times those window names are referenced

(Note that is a simplistic explanation, but it is quite doable, and would be reusable code if done correctly).

For a fee, I’d be glad to design/write it for you… :slight_smile:

what if they are referenced in code that never gets compiled in ?
ie/

#if false
     dim w as windows = window3
#endif

that should not count as Window3 as “used”
and things can get a lot more elaborate than this

[quote=344793:@Dave S]Save it as XML,
write a program to read that XML and extract all the Window Names
then do a 2nd pass to find how many times those window names are referenced

(Note that is a simplistic explanation, but it is quite doable, and would be reusable code if done correctly).

For a fee, I’d be glad to design/write it for you… :)[/quote]

Thanks for the hint but I think I’ll write it by myself ;-).

Whaoooooo !

Can’t you use Containers instead of new windows? Are all 500 unique?

All windows are unique.
Meanwhile I wrote a little app just like Dave described.

I’ve seen ones that have > 1000 windows that have > 1000 controls on a majority of windows
And 1000’s of menus bars
And thousands of containers
All in the same project

One takes nearly 15 minutes to load

[quote=344895:@Norman Palardy]I’ve seen ones that have > 1000 windows that have > 1000 controls on a majority of windows
And 1000’s of menus bars
And thousands of containers
All in the same project

One takes nearly 15 minutes to load[/quote]
That project is called Xojo? :wink:

The IDE isn’t anywhere like that

This was a customer project submitted wondering why the IDE took so long to load their project