Last night Tamar Granor was in Detroit and stopped by the DAFUG meeting to present her excellent session “Using the VFP Debugger Effectively.”
I have done sessions on the VFP debugger and think I have a good handle on debugging, but as usual for me in any session there were some points Tamar made that I was able to “relearn”, and one particular point I did learn and wanted to share with you.
During the session Tamar mentioned the “Fix” feature of the Trace Window is available when you run in the Debug Frame, but is not available in the Trace window when running in the Fox Frame. The Fix feature directs the VFP debugger to cancel the execution and open up the current source code in the appropriate designer and code editor. This feature saves you the time of closing the debugger, getting to the project, opening up the source, and finding the line of code you want to fix. This took me by surprise as I thought I used the Fix feature, and I normally run the debugger in the Fox Frame.
Now anyone who knows me knows I have been very wrong about some VFP stuff in the past and this could be another one of those moments where I am imagining the behavior. So I open a simple PRG I was working with recently and ran the program in the debugger. Sure enough, when I right-click on the Trace window the Fix option is disabled. Hmm, I should not be shocked that Tamar is right and I am wrong, but I really thought this should work. I could just have easily been running with the Debug Frame when I use the Fix because I do switch to the Debug Frame when I want to load a debugger configuration from time-to-time (wish the Fox Team had time to add this to the Fox Frame too).
I have the program run a form (SCX). In the form’s Init method I SET STEP ON. When the code stops I right-click to bring up the shortcut menu. Sure enough the Fix option is enabled and the form opens when I ask VFP to Fix it. I did the same thing in a class and the Fix option is enabled. Interesting – programs get the short end of the stick with the Fix feature. More importantly, if you are using PRG-based classes you are getting the short end of the stick with respect to this powerful time-saver.
The reason I was so sure it was available is I use Visual Fox Express for many of the projects I develop, and the code is almost entirely included in VCX classes. So the option is almost always available to me when I am using the debugger.
So do you think this is a bug in the debugger? Tamar is under the impression there might be some internal limitation the Fox Team cannot work around to get it the source code open when running in the Fox Frame. I am thinking if they can get it to open forms and classes, they probably should be able to get it to open the less complex PRG file. Unfortunately I also think this is a minor problem and I would rather they work on more complex issues before shipping VFP 9 SP2.