Background
Total Visual CodeTools supports all VBA/VB6 hosts, including Visual Basic 6.0 (VB6) and Microsoft Office (including Microsoft Access, Excel, Outlook, PowerPoint, Word, etc.). Loaded directly into the Integrated Development Environment (IDE), Total Visual CodeTools gives you a rich set of coding tools to increase your productivity and make your entire development team more effective.
Question
Why is the Unused Variable Analysis Showing Variables that are Used by My Project?
Answer
Unused Variable Analysis is very useful for finding unused variables in your modules so you can delete them.
Total Visual CodeTools understands variable scoping rules for public and private variables, and the difference between regular modules and classes. For more details, visit: Unused Variable Analysis.
The list of unused variables may include variables that are used. That may seem wrong but it can occur if you don't select the correct modules for analysis.
Cause
Assuming your project code doesn’t have syntax problems (you can compile and run it), you may not have selected all the objects for analysis.
Unused Variable Analysis is performed on the code you select. Total Visual CodeTools lets you select the current procedure, current module, or specific module(s).
- For variables defined in a procedure, you can just choose the procedure for analysis.
- For declaration level variables that are private to a module, you can just choose that module.
- For global variables for the whole project, you need to choose all the modules in the project that could reference it. You cannot just choose the module where the variables are defined.
Select the third option and press the [Select All] button.
Comments
0 comments
Please sign in to leave a comment.