While programming it's inevitable that local variables will be created and later disused and they seem to have a habit of not being removed. I wrote a utility program about 10 years ago to parse DF source code and find them but it required too much effort to fire it up and point it to the workspace & particular code file I wanted to check so I didn't use it as often as I should have.

Having a little extra time this weekend I made a few improvements to it.
1. Changed the old output window to an edit object in the view
2. Added command line functionality to it so that it can be run from within the Studio or The Hammer
3. I found that Wil had changed the vdf-Guidance.com vWin32fh.pkg file to be a library so incorporated that in the workspace

So now you can add UnusedVariables.exe to the Tools menu in both the Studio and The Hammer and if configured correctly with the current source code file name you can check for unused variables with a couple of key clicks. Or run it stand alone as in the past.

Find it here...