I have finished my app I thought I would share it.
It searches source code for unused GLOBALs, LOCALs and DIMs and deletes them!
You can step through the un-used variables one by one looking at
your source code in a window and then choosing to dump them or keep
them.
I have tested on a project with 10 includes (some in the WinApi folder)
it does not dump variables out of the INCLUDES it only checks them
to verify that a GLOBAL is used.
Teh concept is that you only need to process an Included file once
after that its the main project file that needs processing.
However, if you launch the app first and then drag and drop a bunch
of files onto it, they will all be processed automatically (no user
options tho) If you want to see whats going on and go step by step
and create a report, drag a single file onto the icon to launch it.
It will work for split line declarations of any kind and arrays
declared as anything (MyType, WIN32_FIND_DATA etc etc)
It will allow TYPEs declared anyway I know how.
After it has deleted the un-used variables it does a little cleanup
and you can immediatly compile your code.
It will also create a report of the unused variables,
if they were deleted or not, if there are local and Global vars with
the same name, the function and line number and filename.
I have tested it with 15 examples that between them cover all the
permutations I could come up with. THey are below.
The program assumes the code will compile befor you process it.
The method I have used is a little different form the first app
posted, but it seems robust.
If you find any code it has trouble with pls post a short (40lines or less)
example that illustrates the problem and Ill work on it, or you
are welcome to develop it yourself
Its not fast. I must admit i took the direct approach and did not
take alot of trouble to consider the speed. Im sure it could be
imporved upon by all you great programmers.
Finally ater a week of this, I have two things to say to the PB guys...
Im not worthy .... Im not worthy ....
Examples in Source Code forum ...
------------------
Kind Regards
Mike
[This message has been edited by Mike Trader (edited July 28, 2001).]
It searches source code for unused GLOBALs, LOCALs and DIMs and deletes them!
You can step through the un-used variables one by one looking at
your source code in a window and then choosing to dump them or keep
them.
I have tested on a project with 10 includes (some in the WinApi folder)
it does not dump variables out of the INCLUDES it only checks them
to verify that a GLOBAL is used.
Teh concept is that you only need to process an Included file once
after that its the main project file that needs processing.
However, if you launch the app first and then drag and drop a bunch
of files onto it, they will all be processed automatically (no user
options tho) If you want to see whats going on and go step by step
and create a report, drag a single file onto the icon to launch it.
It will work for split line declarations of any kind and arrays
declared as anything (MyType, WIN32_FIND_DATA etc etc)
It will allow TYPEs declared anyway I know how.
After it has deleted the un-used variables it does a little cleanup
and you can immediatly compile your code.
It will also create a report of the unused variables,
if they were deleted or not, if there are local and Global vars with
the same name, the function and line number and filename.
I have tested it with 15 examples that between them cover all the
permutations I could come up with. THey are below.
The program assumes the code will compile befor you process it.
The method I have used is a little different form the first app
posted, but it seems robust.
If you find any code it has trouble with pls post a short (40lines or less)
example that illustrates the problem and Ill work on it, or you
are welcome to develop it yourself

Its not fast. I must admit i took the direct approach and did not
take alot of trouble to consider the speed. Im sure it could be
imporved upon by all you great programmers.
Finally ater a week of this, I have two things to say to the PB guys...
Im not worthy .... Im not worthy ....
Examples in Source Code forum ...
------------------
Kind Regards
Mike
[This message has been edited by Mike Trader (edited July 28, 2001).]
Comment