Posts Tagged ‘Code References’


From the files of Captain Obvious: Code References does not search open files. I know, duh.

Tonight I was searching for all the places a table column is used in an application. I pulled out the always trusty Code References tool (one of the nicest tools Microsoft has included in the last couple of releases of Visual FoxPro in case you are still using VFP 7 or earlier) to perform the text search of all the files in the project. The search result list comes back with less than stellar results because it does not show any place where this column is used. I know it should be manipulated and even set as a ControlSource in one object in this form I have open, and yet the results show nothing. Argh. I have the form open!

The key to understanding what is going on is to pay attention to the Warnings/Errors details displayed in the pane at the bottom of the Code References window. This will list off all the problems the Code References’ search came across when it was looking up the text you asked it to find. In this case the form I had open was not searched and this was the form with all the code to work with the column in question.

So the moral of this lesson is to always review the status at the bottom of Code References for the search you just performed. One more bonus tip, the warnings and errors are retained as long as you keep the search results. In my particular case I was able to close the Form Designer, click on the Code References Refresh button, and see the results I was expecting.

, ,