|
|
RAS/G2 Miscellaneous VFP Tools
G2 SuperClass Enhancement (g2supercls.zip - 160KB)(Updated 14-Jun-2001, Posted Oct-2001) Most Visual FoxPro developers are familiar with Ken Levy’s SuperClass utility. This utility works as a visible toolbar whenever the method editor is opened. The first toolbar button (see Figure 5) allows you to edit the code in the superclass (parentclass). You cannot open the superclass to edit code when the subclass is already open in the Class Designer. This tool provided developers with a way to peak at the code to see what they might be completely overriding or to determine how to extend behavior with a call to the superclass via a DODEFAULT() or a call up the class hierarchy via a direct call via the Scope Resolution Operator (::). Right-clicking on the Edit Superclass button will show all the classes in the hierarchy so you can select which level of code to review.
Drew Speedie, architect of Visual MaxFrame Professional extended this tool with an additional button. The functionality he added displayed all the code in each of the superclasses in one edit window. This code cannot be edited in any fashion, but it quickly allowed the developer to see all the code that would be executed provided that the appropriate calls were made in the hierarchy. However, this tool is shipped with VMP, and requires code in VMP to run. Since my partner Steve Sawyer and I are fond of Drew’s additional feature, but we are using another framework at the moment, we decided to hack Ken’s source code and plug in Drew’s functionality in a generic manner, one that is independent of the VMP framework code. (Thanks to Ken Levy for this indispensable tool and Drew Speedie for the idea of showing all the code in the class hierarchy). RAS DBC ShowPlan Analyzer (rasspanalyzer.zip - 11KB)(Updated 26-Jan-2002)
This program is designed to be used by VFP 7 and documents the ShowPlan for all local views in the selected database container, using SYS(3054). Each view in the database container is opened, the ShowPlan is saved to a memory variable (one reason it requires VFP 7), combined with the others and eventually saved to a file for human analysis. The results are displayed after the view performance is checked. The optional Show SQL (third parameter) might seem redundant to the 2 and 12 options on ShowPlan Level for SYS(3054), but it is the author's experience that these do not work as expected. The utility also does some basic formatting of the SQL to make it wrap and be more readable. The database path is temporarily added to the SET PATH so developers who have separate view database containers from the table database container (and have them reside in the same directory) will have automatic access to the table database container. If the table database container resides in a separate directory, add the database directory to the SET PATH before running this utility or you will be prompted and have to select it. All this is handled in a private datasession so the environment is safely re-established when completed. RAS Class Browser Add-ins (rascbadd.zip - 4KB)(Updated 22-Jan-2000) This file provides two VFP Class Browser add-ins that provide specific enhancements to the look and feel. Run the programs from the Command Window to self-register the add-ins in the Browser.dbf file. The add-ins are automatically loaded when the Class Browser is started once they are registered. There will be no changes to the Class Browser's Add-in menu since they are auto loaded during the Activate method. They also are good examples to get started building your own add-ins which will likely be a bit more complicated than either of these <g>.
Pack Metadata Tool (packmeta.zip - 5KB)(Updated 14-Nov-1998) This program packs all the Visual Class Libraries and Forms that are contained in a selected project file. This PACK removes all the "memo bloat" that naturally occurs during a development cycle. PackMeta.prg was featured in the article Build Developer Tools Using Metadata in the April 1998 issue of FoxPro Advisor. Visual Class Library Subclasser (subclass.zip - 3KB)(Updated 18-Mar-1999; Posted on 22-Sep-1999) This program subclasses all the classes in a Visual Class Library. This can be handy when subclassing all the classes from a third-party framework. I also use this in my personal framework application wizard to subclass some specific class libraries needed for the application level. Some changes you might want to make are noted #DEFINEs in the beginning of the program. SubClassLibrary.prg was featured in the article Build Developer Tools Using Metadata in the April 1998 issue of FoxPro Advisor. Editor Comment String Setting (editcom.zip - 46KB) - Currently only in .EXE format(Updated 24-Oct-1999) Please note that this feature is exposed in the VFP 7.0 Options dialog! This tool is related to the comment/uncomment feature introduced with the VFP 5.0 Editor. This feature can be accessed from the editor shortcut menu or Format menu. Select the comment option will place a "*!*" in front of the code you have highlighted. Selecting code lines that have a "*!*" at the beginning of the code and running the uncomment option will remove the comment string. I find this new feature very handy when temporarily commenting out code. It would be even better if it was customizable so I could implement a standard I have for commenting out code temporarily and commenting code that is replace. During the VFP 5.0 beta many of the developers requested an enhancement to customize this feature from the Fox Team at Microsoft. If you have been around Visual FoxPro very long you already know that the Microsoft Wishline exists and that most enhancements to VFP are a direct result of the requests of the FoxPro development community. At the FoxPro DevCon that year it was "revealed" that the comment string is customizable! I cornered one of the developers of FoxPro and tracked down the secret setting to make the editor comment string something other than "*!*". All the Tools|Options settings are saved in the Windows 95/98 or NT Registry. The editor comment string is also stored in the registry, but is not available on the Options dialog. You need to add the entry into the Registry manually. The entry is: HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\5.0\Options\EditorCommentString Please be careful when modifying the Windows Registry. You can modify and view the registry entries by running RegEdit. First you add the registry key, then set the value to the comment string you want placed in the code when you use the comment feature. I wrote a quick Visual FoxPro utility that changes the value in the registry so I can bypass RegEdit. This is an interface that leverages the CodeBook CRegistry Class to modify the setting. Please be careful when modifying the Windows Registry. You can modify and view the registry entries by running RegEdit. First you add the registry key, then set the value to the comment string you want placed in the code when you use the comment feature. I wrote a quick Visual FoxPro utility that changes the value in the registry so I can bypass RegEdit. This is an interface that leverages the CodeBook CRegistry Class to modify the setting. You can modify and view the registry entries by running RegEdit. First you add the registry key, then set the value to the comment string you want placed in the code when you use the comment feature. I wrote a quick Visual FoxPro utility that changes the value in the registry so I can bypass RegEdit. This is an interface that leverages the CodeBook CRegistry Class to modify the setting.
Hopefully we will only need this utility until VFP gets this setting configured to the Tools|Option dialog. An important note about this setting is that VFP 5.0 only checks the registry for this entry when it starts up. If you change this setting when you are running VFP 5.0 you will need to restart it, otherwise the setting is not used until the next session. This is not needed with VFP 6.0 since SYS(3056) will re-read the registry settings. After setting the string, run the SYS(3056) function in the command window to implement the change. I like to just say thanks to Calvin Hsia from Microsoft for revealing this undocumented feature. Now if I could only find the hidden setting to see if spaces can be used in the indent/unindent feature. |
This site is designed to be viewed in 800x600 video resolution or higher, but it should work fairly well at any resolution and with any of the major browsers (all free!). Optimized for MS Internet Explorer, Firefox, and Opera (mostly works with Mozilla and Netscape Navigator). Copyrighted 1998-2005 Richard A. Schummer |