Copyright: Visual Help ® 1993-1994 Firas Bushnaq


TB CodeDoctor Contents
CodeDoctor Contents

Click the desired Topic below to get a description for the respective CodeDoctor Function:

A

Appearance

B

Bitmap Clipper

C

Clone A Visual Basic Form

Code Editor

Code Finder

CodeDoct.INI File

Comment

Common Dialog Designer

Concatenate Code Blocks on Clipboard

Contents

Copy Controls & Code

Copy Menu

D

Delete Code Only

Delete Controls and Code

G

Glossary

H

Help Context Ids

Hot Buttons

I

Icon Clipper

Indent

Input Box Designer

Introduction

M

MsgBox Designer

P

Picture Clipper

R

Registrartion

S

Set Appearance Window

Set Tab Order

Setting Context ID's

Support

T

Tab Order

U

Uncomment


Clone
Clone a Visual Basic Form

Many times you need a new form which is almost a duplicate of an existing form, either in the current project or another project.  CodeDoctor will copy an existing form from any project, including your current project, and reproduce it in any other project, including your current project.  In the process, the file name, internal from name, and any references to objects in its associated FRX file, will be changed so that the new form does not appear to VB to be a duplicate form.

To clone a form, simply click the Clone Menu Option.  You will be prompted for three things:
     1. Select the form to be copied.
     2. Select the file and path to store the new form.
     3. Input a name to be used for the internal Form Name.

Everything else is automatic.  Once you have been notified that the form has been cloned, it will be automatically added to your project.


Code Finder

The Code Finder provides the ability to find any text string either in a Project of Visual Basic Files or in any .CLS, .BAS, .FRM, or .PRG file.

Optionally, you may find where a variable or Function/Sub is defined, referenced, or in the case of a variable, where it is written to (stored into).

This valuable feature is most useful when you are attempting to find, for importing purposes, code which is located in a project that is different from the project on which you are currently working in Visual Basic.

In order to find code or a text string, first select a Visual Basic Project or a Directory in which you expect to locate the desired string or code sample.  Once the Project or Directory has been selected, you can select the usage of the variable or Function/Sub that you wish to find.

Having selected the desired options, click the Find Button to be prompted for the text string that you wish to find.  The Find Button has a hot key (F2) and the Find Next Button can be activated by pressing F3.

To terminate the current search and institute another, click the Stop Search Button and then click the Find Button to be prompted for the next variable to find.

From the Hot Button Toolbar, you can find where a variable is defined (Dim, Global, Const) by highlighting the variable name in a code window and click on the Find Definition Tool Button.  The Code Finder will be loaded and the selected variable name will be automatically located without further prompting.   If you wish to see if there are multiple definitions, click the Find Next Button on the CodeFinder form.

Additionally, you can automatically find where a variable is stored into by selecting the variable name in a code window and clicking the Find Modifier Tool Button on the Hot Button Toolbar.


CodeDoct.INI File
CodeDoct.INI File Format

The CodeDoctor INI file is normally maintained by CodeDoctor and should not require any manual maintenance.  There is only one normal reason for changing anything in the file.  CodeDoctor has a default Tab Length of 3 characters.  The Tab length is found in the first character of the INI file.  Changing it from 3 to 4 would change the Tab length used in the Indent Function to 4 characters.  Although the remainder of the file is documented below, do not attempt to tamper with the file.  If the file gets corrupted, CodeDoctor will not work.

Format of the INI file is:

   Char 1 - Tab Length
   Char 2 - Hot Button Length Flag, E=Extended, S=Short, N=None
   Char 3-7 - Left of Toolbar
   Char 8-12 - Top of Toolbar

   Remainder is undocumented and must not be tampered with!


CodeEditor

One of the features missing from Visual Basic is the ability to load and edit files which are not in your current project.  This means that you must employ a separate text editor.  CodeDoctor has its own editor which is invoked by selecting the External Editor from the CodeDoctor Utility Menu.

Many of the options that are available to the Hot Button ToolBar are also available in the Edit Window, but the Tool Buttons on the Edit Windows obviously apply to the text in that Editor, not to VB Code  Windows.  That type of operation is done only from the Hot Button toolbar or Add-In Menus.

A helpful additon to the File Menu in the Editors is the File and Module Sub Menu's which automatically select the file type for the Common Dialog File Open Window.  Additionally, using the Module Option will allow you to open a file and then select only the desired procedure from that file to be brought into the Code Window.

The CodeDoctor Editor has a xBase Converter built into it.  You can load the procedures of an xBase .PRG file into the Edit Window and select all of the text (Ctrl A) and click on the XB-VB Tool Button.  The code will be converted from xBase (dBase III+, Clipper, FoxPro) to Visual Basic Syntax.  The converter will convert up to 90% of the "non user interface" code to VB syntax.

The CodeDoctor Editor has a limit in the Code Window to approximately 30K, in the 16 Bit Version of CodeDoctor.  This means that any "Whole File" which is to be loaded must not exceed 30K, or any Sub or Function within a "Module" load must not exceed 30K.  This restriction applies only to the 16 Bit version of CodeDoctor.  The 32 Bit Version has no such limitation.


Comment

CodeDoctor will comment a block of code in any Code Window of Visual Basic.  The process is automatic.

To Comment a block of code, simply highlight (select)  the block of code to be commented, and click the Comment Button (first button on the left) on the CodeDoctor Hot Button ToolBar or the Desktop, Comment menu option on the Add-in Menu.  The only requirement is that the Code Window in which you wish to comment the code be the active window when you click the Comment Button on the CodeDoctor ToolBar.  CodeDoctor will pickup the code from the window that was active just prior to its own activation.

Do not attempt to use the Comment Button on the Hot Button ToolBar to comment code in the TB CodeDoctor Editor Window.  Instead, use the Editor's ToolBar Comment Button.


Common Dialog Designer

CodeDoctor has a Common Dialog  designer that allows you to design a Common Dialog, test the code, and then paint the code into your Visual Basic Code Window.

To activate the Common Dialog Designer, click the Common Dialog Menu Option from the Codedoctor CodeGen Menu.

Once you have selected your desired options, click the Test Button to see the display of your newly designed MsgBox.  Click the Show Code button to see the code that will be generated.

Click the Paint It Button to paste the code directly into your Visual Basic Code Window.


Concatenate
Concatenate Code Blocks on Clipboard

CodeDoctor will Concatenate blocks of code from any Code Window of Visual Basic.  The process is automatic.

To concatenate a block of code, simply highlight (select)  the block of code to be concatenated, and click the Concatenate Button  on the CodeDoctor Hot Button ToolBar.  The only requirement is that the Code Window from which you wish to concatenate the code be the active window when you click the Concatenate Button on the CodeDoctor ToolBar.  CodeDoctor will pickup the code from the window that was active just prior to its own activation.

This Tool Button will allow you to pick up selected pieces of code from many sources, assembling it on the Cllipboard and finally paste the completed procedure or program to Visual Basic or any other Text Editor.


Copy Controls
Copy Controls & Code

Obviously, you can copy controls from one form to another in VB by selecting the desired controls, copying them to the Clipboard, and then pasting them to the new form.  That's easy enough, but what about the code behind the controls?.

Before attempting to copy controls, Save your Project.  To copy controls and all of the code behind them, simply select the controls on the source form as you would to copy to the Clipboard.  Once you have selected the controls, select the Copy Controls option from the CodeDoctor Utility Menu.  You may copy one or more Container controls with one selection and CodeDoctor will automatically copy all of the controls within each of the Containers, along with their code.  Selecting the Copy Controls Menu Option will set up everything for the next step.

When the controls and code have been copied to a temporary storage for subsequent pasting, a completion message will be displayed.  DO NOT ATTEMPT TO PROCEED WITH THE PASTE OPERATION UNTIL PROMPTED TO DO SO.

Next, click on the form that you wish to copy the controls to, and then select the Paste Controls on the CodeDoctor Utility Menu.  You should see the selected controls appear on the second form and their associated code will be on the form also.  The process of copying controls and code is a complex and time sensitive process.  In the unlikely event that the controls do not appear on the second form, do not save the form.  Even though the controls have not been copied, the code will be there.  In this case, to delete the code and restore the form to it's original state, select the Refresh Project Option from the CodeDoctor Desktop Menu.  Once the project has been refreshed, you can reselect the controls and select the Copy Controls option once again.

When CodeDoctor is finished pasting the controls and code, a message will be displayed informing you that the operation is complete.  Please do not click the mouse or type on the keyboard until you receive this confirmation.

If you are using Visual Source Safe or any other version control software, the destination file and the project "make" file must be checked out prior to attempting to copy controls or a menu.


Copy Menu

You can copy a Menu and it's code using the Copy Menu option on the CodeDoctor Utility Menu; Follow the prompts.  Before attempting to Copy Menu, Save Your Project.  This function will copy the Menu from any form in any project to any form in the current project.  The code for the menu will also be copied.

A confirmation message will be displayed when CodeDoctor has completed copying the Menu and code.

If you are using Visual Source Safe or any other version control software, the destination file and the project "make" file must be checked out prior to attempting to copy controls or a menu.


Delete Code Only

Having cloned a form using CodeDoctor, you may find that you want to use some of the controls, but you you don't need, or want, all of the code behind all of the controls.

To delete all of the code behind selected controls, simply select the controls on the form whose code you wish to delete.  Once you have selected the controls, select the Delete Controls option from the CodeDoctor Utility Menu.  Although this function will delete the Controls and their associated code, the Controls will be on the Clipboard.  To replace the controls without the code, simply click the form, and press Ctrl_V to paste the controls back on the form.

If you are using Visual Source Safe or any other version control software, the form file and the project "make" file must be checked out prior to attempting to delete controls.  You can not delete a Menu's code using this menu option.


Delete Controls and Code

Deleting controls from a form is a snap in Visual Basic.  You just select the controls and press the Delete key.  The only problem is that you are left with the code on the form, which will now be displayed in the General Section of the Code Window.  Many controls will may have multiple events, leaving you with the rigorous job of ferreting out all of the code and deleting it, or leaving the unused code on the form.

Before attempting to Delete Controls & Code, Save Your Project.  To delete controls and all of the code behind them, simply select the controls on the form as you would, to prepare to delete them with the Delete key.  Once you have selected the controls, select the Delete Controls option from the CodeDoctor Utility Menu.  You may delete one or more Container controls with one selection and CodeDoctor will automatically delete all of the controls within each of the Containers, along with their code.

Deleting controls and code will take several seconds because of timing controls built into this function.  A message will be displayed informing you when the operation is complete.  Please do not click the mouse or type on the keyboard until this confirmation is received.

If you are using Visual Source Safe or any other version control software, the form file and the project "make" file must be checked out prior to attempting to delete controls.  You can not delete a Menu and it's code using this menu option.


Glossary

C

Clone

Comment

Concatenate

Convert

E

Edit Window

I

Indent

InputBox

M

MsgBox

R

register

Registeration

U

Uncomment

X

xBase


Hot Buttons

CodeDoctor automatically places a Hot Button Toolbar on top of the VB Form and this gives the appearance that VB has additional ToolButtons.  The Toolbuttons are self documented by Tool Tips.  The functions available from the Hot Button Toolbar are:

•	Comment selected text

•	Uncomment selected text

•	Indent - Indent selected text

•	Close all Code Windows

•	Vertically Tile all Code Windows

•	Horizontally Tile Code Windows

•	Cascade Code Windows

•	Previous Function - Returns to Previous Function (Ctrl-Shift-F2)

•	Move the Hot Button Toolbar

•	Minimize, extend or abbreviate, or remove the Hot Button Toolbar

•	Find where a selected variable is defined (Dim, Global, Const)

•	Find where a selected variable is stored into

•	Toolbox - Load VB's Toolbox

•	Set Tab Order - Show Tab Order Window for quick and easy Tab Order Setting

•	Appearance - Shows Appearance Window for sizing, spacing, etc. of selected controls

•	Debug Window - Load VB's Debug Window


Icon Clipper

The Icon Clipper will extract Icons from any .EXE, .DLL,  or .ICO file.  It will also display any small Bitmap from a file of Bitmaps that are used for tool buttons, etc.

To extract icons from an .EXE, .DLL, .BMP, or .ICO file, select the directory and then the file.  When you click on the file, all of the Icons (max of 12) will be extracted from the file and displayed on the bottom of the screen.  To display a single icon or bitmap, click on the file name (.bmp, .ico).

To copy the Icon to the Clipboard, click on the desired picture (Icon) and select the Copy button.  The Icon will be placed on the clipboard where you can copy it to an image editor for possible modifications.


Indent
Indent Selected Code Block

CodeDoctor will indent a block of code in any Code Window of Visual Basic as well as any other text editor that accepts Cut and Paste commands.  The process is automatic; that is, you do not have to tell CodeDoctor which program is being used as an editor.

To indent a block of code, simply highlight (select)  the block of code to be indented, and click the Indent Button on the CodeDoctor ToolBar.  The only requirement is that the editor in which you wish to indent the code be the active window when you click the Indent Button on the CodeDoctor ToolBar.  CodeDoctor will pickup the code from the window that was active just prior to its own activation.

Do not attempt to use the Indent Button on the Main ToolBar to indent code in one of the CodeDoctor Editor Windows.  Instead, use the respective Editor's ToolBar Indent Button.


Input Box Designer

CodeDoctor has an Input Box designer that allows you to design an Input Box, test the code, and then paint the code into your Visual Basic Code Window.

To activate the Input Box Designer, click the Input Box Menu Option from the Codedoctor CodeGen Menu.

Once you have selected your desired options, click the Test Button to see the display of your newly designed MsgBox.  Click the Show Code button to see the code that will be generated.

Click the Paint It Button to paste the code directly into your Visual Basic Code Window.


Introduction
CodeDoctor Introduction

Code Doctor for Visual Basic 4.0 is an Add-in which provides many basic features that are invaluable in the Integrated Development Environment, but which are not inherent in Visual Basic.  These features are the ability to Comment, Uncomment, Indent,etc., selected blocks of code at the click of a Tool Button or selection of a menu option.

Additionally, CodeDoctor provides a button for concatenating code on the Clipboard which allows the developer to Cut and Paste from several sources, using the clipboard as a staging area.  This is very useful when you need to combine several snippets of code into one block prior to pasting it into a program.

CodeDoctor has its own External Code Editor which allows you to go outside of the current project to find, manipulate, and import code to the current VB Project.

CodeDoctor, once selected in the Add-in Manager, will be automatically loaded each time you load VB 4.0.  It has it's own Hot Button Toolbar which can be positioned anywhere on the screen, including taking on the appearance of being part of the the Visual Basic ToolBar.  It will always load on top of the VB Form and is set as "Always on Top".

We trust that you will find CodeDoctor an invaluable addition to your development environment. If you have gotten your copy from Shareware, and  If you like it and continue to use it, please register it through the SWREG Forum on Compuserve. If you have an unregistered copy of CodeDoctor, you will only be able to use it for 15 days without registering it.  When you register CodeDoctor, you make us able  to continue to provide you with high quality software at prices far below that of commercial software.  The price of registering CodeDoctor is just $39 plus $5 for handling.  You will save that in development costs the first day you use it.  Thank you for trying CodeDoctor!


MsgBox Designer

CodeDoctor has a MsgBox designer that allows you to design a MsgBox, test the code, and then paint the code into your Visual Basic Code Window.

To activate the MsgBox Designer, click the MsgBox Menu Option from the Codedoctor CodeGenerator Menu.  In the MsgBox Designer, you can choose the Icon, Title, Function or Sub Call, and if you select a Function Call, you can select the response buttons.

Once you have selected your desired options, click the Test Button to see the display of your newly designed MsgBox.  Click the Show Code button to see the code that will be generated.

Click the Paint It Button to paste the code directly into your Visual Basic Code Window.


Registration

This version of CodeDoctor is Shareware.  That means that you can have professional, industrial strength software for a fraction of price that you would pay from a software development house.

Shareware does not mean that the software is free.  CodeDoctor took literally hundreds of hours to develop.  It is a quality product and can save you hours of development time.  If you like CodeDoctor, and plan to continue to use it, please register it via the SWREG forum of Compuserve.  CodeDoctor has a price of $39 plus $5 for handling charges.  That's a Real Bargain!  The bottom line is that the only way we can continue to provide you with quality products at rock bottom prices is for you to register the Shareware Software that you use.

Thank you for trying CodeDoctor.  If you register your copy,  you can contact us on Compuserve for fixes to any bug that you should encounter in CodeDoctor.


Set Appearance Window

To show the Appearance Window, select the Set Appearance Menu Option from the CodeDoctor Utility Menu or if the Hot Buttons Toolbar is visible, click the Set Appearance Tool Button.

The CodeDoctor Appearance Window has numerous options for sizing, aligning, spacing, and altering the appearance of the selected controls.  To use any of the appearance buttons, select the controls to be manipulated and select the desired button.

The "Align" Buttons provide Align Left, Align Top, Align Bottom, and Align Right functionality respectively.

The "Space" Buttons provide Space Horizontaly and Space Vertical respectively.

The "Size" Buttons provide Size Horizontal, Size Vertical, and Size Both respectively.

The "Font" Buttons provide Font Bold and Font Regular respectively.

The "Appear" Buttons provide "3D" and "Flat" appearance respectively.

The vertical spacing option will vertically space all selected controls using the space between the topmost control selected and the second topmost control.

The horizontal spacing option will horizontally space all selected controls using the space between the leftmost control and the control on it's immediate right.

The Appear 3D and Font Regular options are used to convert controls on forms converted from VB 3.0 to the Windows 95 look.


Set Tab Order

Setting Tab Order is a snap with CodeDoctor.  First, select the Set Tab Order menu option from the CodeDoctor Utility Menu, or if the Hot Buttons Toolbar is visible, click the Set Tab Order Tool button.  You will see the Set Tab Order form load in the upper right corner of your screen.  Next, click on the control that you want to have the focus when the form is loaded, and then click on the Set Tab button on the Set Tab Order form.

From there, simply toggle between selecting the next control(s) and the Set Tab Button.  If you make a mistake, simply click the Reset Button on the Set Tab Order Form and start over.  Clicking the Reset Button sets the beginning Tab Index Counter in CodeDoctor  to 0, it does not reset the Tab Indexes, that you have already set, to their original positon.


Setting Help Context IDs
Setting Help Context ID's

One of the rigorous tasks in completing a Windows program is to set up the Context Id's for your Windows Help File.  CodeDoctor has a facility for aiding in this process.

Once you have built a Help file, you will have an RTF (Rich Text File) which has Context ID's built into it (automatic when using a help building tool).  To set the appropriate Context Id in each of your controls on a form, do the following:

1 	Select the "Select Help Topic" option from the CodeDoctor Utility Menu.  Once the Help Id form is loaded, click the Open RTF button.  You will be prompted to select your RTF file from the Common Dialog.  This form for selecting Topic Id's will stay on the screen until you close it.

2 	Select the desired Help Topic from the Combo Box.  Next, select a control or controls on your VB Form that you wish to receive the selected Context Id.  Click the "Set Index" button on the Help Context Id Form.  CodeDoctor will set the selected ID into the Context Id Property of the selected control(s).

3 	Repeat Step 2 until you have set all of the control's context ids.


Support for CodeDoctor

If you encounter any problems or bugs with CodeDoctor, you can send a note to HHI Software at 72123,121 on Compuserve.  Upon receipt of any bug report, we will attempt to correct the problem and update the version of CodeDoctor on the MSBasic Forurm.

Should you encounter any problem installing CodeDoctor, please send a note to us at the address listed above.


Uncomment

CodeDoctor will Uncomment a block of code in any Code Window of Visual Basic as well as any other text editor that accepts Cut and Paste commands.  The process is automatic; that is, you do not have to tell CodeDoctor which program is being used as an editor.

To Uncomment a block of code, simply highlight (select)  the block of code to be uncommented, and click the Uncomment Button (second button on the left) on the CodeDoctor ToolBar.  The only requirement is that the editor in which you wish to uncomment the code be the active window when you click the Uncomment Button on the CodeDoctor ToolBar.  CodeDoctor will pickup the code from the window that was active just prior to its own activation.

Do not attempt to use the Uncomment Button on the Hot Button ToolBar to Uncomment code in one of the CodeDoctor Editor Windows.  Instead, use the respective Editor's ToolBar Uncomment Button.


Clone

The Clone function will copy an existing Visual Basic Form and change its internal name in the .FRM and .FRX files so that the cloned file can be included in the same project from which it was cloned.


Comment

CodeDoctor will place a comment delimiter in front of all lines selected in the Code Window at the time  the Comment button is clicked.


Concatenate

The Concatenate function allows you to clip selected text from multiple places in a function or functions and effectively cut and paste a new block of code together.  It uses the Clipboard as a staging area for the new code.


Convert

CodeDoctor can convert selected text in the CodeDoctor Edit Window from xBase to Visual Basic Syntax.


Edit Window

CodeDoctor provides a Visual Basic "like" code window so that you can do such functions as pick up code from outside the current Project.


Indent

CodeDoctor will indent the lines following a Loop or Decision type statement such as If, Do, For, Select Case, Case, etc.  The Tab size is fixed at 3 spaces.  Keywords that cause the lines to be unindented are End If, Loop, End Select, etc.


InputBox

The InputBox designer allows full control over the generation of code for the Visual Basic InputBox function.  You can test the code prior to pasting it to your Visual Basic Code Window.


MsgBox

The MsgBox designer allows complete control over the generation of code to call either the MsgBox statement or function.  It allows you to test the MsgBox and then paste the code directly to a Visual Basic Code Window.


register

If you plan to continue to use CodeDoctor, please register it via the SWREG Forum on Compuserve.   The cost is $39 plus $5 handling charge.


Registeration

CodeDoctor is Shareware.  If you like it and continue to use it, you should register it with the SWREG Forum in Compuserve.


Uncomment

Remove the comment marker from selected block of text.


xBase

XBase syntax includes dBase, Clipper, FoxPro, and any other variation of dBase syntax.