|
| ||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||
|
Help / Tour
VBCodeHelper creates its own menu, and adds up to 18 buttons and a combo box to its own toolbar within the Visual Basic IDE. A configuration program that is available from the Windows Start menu or VBCodeHelper menu is used to tailor the Add-In for your own requirements. The following functions are provided:
Procedure templates are added either just before the procedure declaration line or just after it depending on the setting in the configuration program. VBCodeHelper assumes that the procedure has already been documented if there is a comment line before the declaration or after the declaration respectively. Uses the boilerplates HEADER_SUB.tld, HEADER_FUNCTION.tld, HEADER_SET.tld, HEADER_LET.tld, HEADER_GET.tld and HEADER_MODULE.tld as appropriate. The boilerplates are stored in a directory as defined by the user with the configuration utility. User-defined tokens are stored in a file named USER_TOKENS.dat and stored in a directory as defined by the user with the configuration utility.
Procedure templates are added either just before the procedure declaration line or just after it depending on the setting in the configuration program. VBCodeHelper assumes that the procedure has already been documented if there is a comment line before the declaration or after the declaration respectively. Uses the boilerplates HEADER_SUB.tld, HEADER_FUNCTION.tld, HEADER_SET.tld, HEADER_LET.tld, HEADER_GET.tld and HEADER_MODULE.tld as appropriate. The boilerplates are stored in a directory as defined by the user with the configuration utility. The standard boilerplates included with the application are based on the style of error handling that we usually use in Frez Systems projects and are dependant on a module level constant being entered manually in each module called MODULE_NAME to define the name of the module, and two functions usually placed in a standard module called FormatErrorSource and ShowUnexpectedError (you can use the VBCodeHelper template insertion tool to insert these two functions by choosing the ERROR_UTILITIES.tlt template. You can quickly insert the MODULE_NAME constant by using a template for the purpose, or alteratively, you can remove the requirement for the constant by replacing the code: MODULE_NAME in the templates with the code: “%MODULE%” However, if you use %MODULE% to insert the module name you will have to update the text should you copy or move the procedure to a different module.
Uses the boilerplates TIMESTAMP.tld, TIMESTAMP_START.tld, and TIMESTAMP_END.tld as appropriate. The boilerplates are stored in a directory as defined by the user with the configuration utility.
When activated with the hot key (CTRL+SHIFT+T) or by selecting from the menu, a form is displayed for you to select a template for insertion. Simply select the template and click on OK.
To save space on the toolbar, or to allow the viewing of longer file names, you can resize the templates combo box. In the IDE choose View | Toolbars | Customize and then use the mouse to resize the templates combo box. When the add-in is unloaded (this happens automatically when the VB IDE is shut down) the size of the combo box is remembered for the next time.
When inserting an error handler in all procedures, any procedure found with an existing 'On Error' statement of some kind will be ignored and a line will be inserted in the Debug window to advise you that it was ignored.
Uses the boilerplates ERROR1_START.tld, ERROR1_END.tld, ERROR2_START.tld, and ERROR2_END.tld as appropriate. The boilerplates are stored in a directory as defined by the user with the configuration utility.
There are also auto-sort buttons that will sort the controls automatically either across and then down, or down and then across. The sorting is influenced by the 'Group by container' checkbox. When the checkbox is checked the controls will be kept together based on their containers (e.g. Frame, PictureBox, Tab Dialog), this is especially useful where containers overlap, for instance where you intend to show and hide frames at runtime. However, should you be using the containers simply as a visual border and want the controls sorted according to their top and left properties regardless of container then you can uncheck the box.
NOTE: The tab order is not changed on the designer window until the 'Apply this tab order' button (resembling a check mark) is selected. You can click on the refresh button at any time to redisplay the controls in the current tab order.
This function is particularly useful when a form is being built with overlapping frames or buttons that are shown/hidden at runtime.
The statistics are displayed in a dockable window, if you click on the copy button at the top of the window the tab delimited statistics are put in the Windows clipboard and can then be pasted into a suitable product for further analysis (e.g. Microsoft Excel).
The list is initially sorted in the same order that the procedures appear within the module and also details whether each procedure has an error handler or whether it is documented. The rules it uses are; if the procedure contains the string ‘On Error’ it is considered to have an error handler, and if the line before the procedure declaration is a comment it is considered to be documented. The procedures within the list can be re-ordered as required using the up and down buttons, drag and drop with the mouse, or the quick alphabetical sort button. In order to apply the changed order you must click on the ‘check’ button. WARNING: Very long modules can take some time to reorganize and is dependant on the speed of your PC. We recommend that you save your code before reorganizing the procedures. The list is not updated with any changes you make in the code window (new, changed or removed windows) until the refresh button, sort button or apply changes button is selected. Should new procedures have been added when the apply changes button is selected, the new procedures will be displayed at the top of the module after the module declaration section.
Standard Token List:
User Defined Tokens: The user tokens file will contain one line for each token and may contain comments that are indicated with an apostrophe. Each line defining a user token contains three parts; the token name that is enclose in % characters (e.g. %DEPT%), a prompt to be displayed for a value to replace the token with, and a default value for the token. The three parts are separated with semi-colon (;) characters. If no prompt is defined the tokens will simply be replaced with the default value provided, and should no default value be provided then a prompt will be displayed with no default. e.g. %DEPT%;Please enter the department name;IT Department
This configuration tool can be run either standalone from the Windows Start menu, or from within Visual Basic when the add-in is running by selecting the Configure VBCodeHelper option on the VBCodeHelper menu. On the first page you can change the location of where the add-in looks for its templates, boilerplates and USER_TOKENS.dat. However, should you change the location you will have to move the files manually yourself.
On the second page you can set the various system tokens.
The third page is used to set error handling and smart indenting options. The 'Normal Error Handler' specifies which of the two error handlers are inserted for most procedures. The 'Error Handler if Procedure Name Contains Underscore (_)' specifies which error handler is used when the procedure name contains an underscore (i.e. usually an event procedure). The 'Add Error Handlers to Property Procedures' allows you to prevent insertion in all property procedures which can often be one line procedures unlikely to produce an error. The 'Number of Spaces For Each Indent' allows you to configure the indentation used for each level of indenting when the Smart Indent function is used. The ‘Indent Declaration Statements (Dim, Static, Const)’ allows you to specify whether you want the declarations up against the left margin or indented like the rest of the code. The ‘Number of Consecutive Lines of White Space Allowed’ allows you to specify the maximum number of blank lines that can appear together. The ‘Add Documentation Before or After Procedure Declaration’ option allows you to specify whether procedure boilerplates should be added before or after the procedures declaration line(s).
The fourth page is used to configure the toolbar; whether it is visible and which of the buttons are visible.
The fifth page is used to setup whether shortcuts, such as Ctrl+Shift+M for Insert Module, are enabled. It is recommended that all shortcuts are left enabled unless you have another Add-In product that conflicts with the VBCodeHelper key assignments.
The sixth and final page gives information about the software and who it is registered to.
If the software has been downloaded from the internet it can be installed by running the download file called SETUP.EXE. Simply follow all the on-screen prompts displayed by the installation program to complete the installation. Please note that you are required to accept the End User Licence Agreement before the installation will complete. After installation of the Add-In it is recommended that you run the configuration utility that you will find in the windows Start menu under the VBCodeHelper group. Please note that should you want to store the templates, boilerplates and user tokens file somewhere other than the default folder (which is a sub-folder called Templates in the installation folder, usually C:\Program Files\VBCodeHelper\Templates), then you will have to move the files yourself and then use the configuration utility to select the new folder(s). For instance, it is quite usual to store the boilerplate files on the network somewhere so that all developers use the same standards, whilst keeping the template files and user tokens file in a local directory.
Q: How can I ensure that all my developers are inserting boilerplates with the same style? Q: How can I include a version history for each procedure boilerplate? Q: How can I add more code templates in the VBCodeHelper combo box? Q: I have a suggestion for an enhancement, where should I send it? Q: Can I quickly remove a boilerplate entered by mistake? Q: Will you be releasing a version for VB.NET? |