Welcome to

Codetainer

Introduction

The Codetainer Add-In is a utility for storing Visual Basic code for future use. It is an Add-In for Visual Basic 5.0 and can not be run independently. It requires Visual Basic 5.0 with DAO 3.5 to be installed on the machine it is installed on. When installed, Codetainer will show up as a new item on the Visual Basic [Tools] menu bar.

Codetainer lets you store procedures and code-fragments in a database. The code is organized in folders, utilizing the finding of a certain procedure or code-fragment.

The folders and the procedures are displayed in an Explorer-like tree to the left while the code (and information about the code) is shown to the right. You can also search the entire database for the occurrence of any string anywhere in the code or comments. When you find a procedure you like you can easily paste it into your current Visual Basic project.

In addition Codetainer has a special function for examining Visual Basic files (forms, classes and code modules).

 

Basic Work Principles

Adding Procedures to the Database

To add a procedure to the Codetainer database you only have to click the menu Add Procedure and give the new procedure a name in the dialog that appears. The new procedure is automatically selected and ready for code to be entered. You can write the code directly or paste it from the clipboard.

When in Module View you can also paste code from an existing file into the database by clicking the menu Copy Procedure to Database.

When you have entered the code you can enter comments, copyright information and information about other procedures that the code depends upon. All changes are automatically saved as soon as you select another procedure or folder.

You can edit code and comments later. Simply select the procedure and enter the changes directly in the Code Pane or a Comment Pane. The changes will be saved when you select another procedure or folder.

Retrieving Procedures from the Database

To find a saved procedure, simply browse through your folders until you find the procedure you like. When you click on the procedure name, the code will be displayed in the Code Pane to the right.

If you don't remember where you stored the procedure, but you remember part of it's name you can use the Find command on the Database Menu to find all folders and procedures that match the string you searched for.

If you don't remember the name of the procedure, but remember part of the code or part of a comment made to the procedure, you can use the Search command on the Database Menu. Search will examine all that is stored about procedures (but not about folders) in the database and display the result of the Search in Search View. This feature could be used for creating a second sorting mechanism beside the Tree View model. Simply put one or more keywords in the description or comment panes of each procedure. These keywords can then easily be sought with the Search command and all procedures matching the keyword will be displayed in Search View.

When you find a procedure you would like to use in your project, just click the Insert Procedure in Module command on the Project menu and the procedure will automatically be added to the current VB Module (be it a form, a class or a regular code module). You can also copy the code to the clipboard through the Copy Code command on the Database menu or select part of the code or a comment and use the normal clipboard commands.

Examining VB Files

Codetainer has a utility for examining VB files (Forms, Modules and Classes). Load files into Codetainer with the Open Module command. When you load such a file in Codetainer the code in the file will be organized into different types of procedures (Declarations, Subs, Functions and Properties) and displayed. You can then examine the code and with a click on the mouse you can add the code in the file to the database (use Copy Procedure to Database) or the current VB project (use Insert Procedure in Module).

Work Modes

Work Modes in Codetainer refers to the two different ways you can inspect the database (Tree and Search View) and to the possibility to inspect saved Visual Basic files (Module View).

Tree View

Tree View is the normal or main method for working with Codetainer. To use Tree View select the [Tree]-tab on the tab strip to the left in Codetainer.

Tree View displays the content of the database in a tree. The procedures are sorted into folders and sub-folders. You navigate the tree in the same way you navigate the file tree in the Windows Explorer. When you select a procedure, the code and comments of that procedure is displayed in the code pane and comment panes to the left.

Use Find to find procedures when you know (part of) the procedure name and Search View to search the entire database.

You can add new folders through the Add Folders command and new procedures through the Add Procedures command. You delete folders and procedures through the Delete command. You can copy the code in the Code Pane to the clipboard through the Copy Code command or paste it directly into the current Visual Basic project through the Insert Procedure in Module command.

Search View

Search View displays the names of the found procedures after a Search command. The result is displayed in a list, sorted on the names of the procedures. The Search command will automatically change Codetainer into Search View. If you would like to go back to Search View later, just select the [Search] tab on the tab strip to the left in Codetainer.

As in other Work Modes, when you select a procedure, the code and comments of that procedure is displayed in the Code Pane and Comment Panes to the right.

You cannot add new folders or new procedures in Search View. You can delete procedures through the Delete command. You can copy the code in the Code pane to the clipboard through the Copy Code command or paste it directly into the current Visual Basic project through the Insert Procedure in Module command.

 

Module View

Module View is the mode in which you can examine existing Visual Basic files such as forms, classes and code modules. You load a VB file through the Open Module command on the File menu. You change to Module View by selecting the [Module] tab on the tab strip to the left in Codetainer.

As in other Work Modes, when you select a procedure, the code of the procedure is displayed in the Code Pane. However, since the code comes from a VB file and not the Codetainer database, there will not be any comments available.

You can copy the code in the Code Pane directly into a new procedure in the database through the Copy Procedure to Database command. You can copy the code in the code pane to the clipboard through the Copy Code command or paste it directly into the current Visual Basic project through the Insert Procedure in Module command.

 

Menus

File

Open Module

This will open a normal Windows file dialog in which you can chose a Visual Basic code module (form module, normal module or class module) for display in Module View.

Print and Print Setup

Print Code will print the current text in the Code Pane to the current printer.

Print Procedure will print the current text in the Code Pane and all the Comment Panes to the current printer.

Print Setup will open the standard windows printer setup dialog in which you can choose printer, paper size and paper bin etc.

Close

This will hide the Codetainer window. Codetainer is not unloaded from memory, though; it will be immediately displayed if you chose it from the Tools menu in the Visual Basic IDE. If you run short on resources and would like to free up the memory used by Codetainer you can close it through the Close command on the system menu. Codetainer will then be completely removed from memory until you start it again through the Tools menu in the Visual Basic IDE.

Database

Add Procedure

This will insert a new procedure in the Codetainer database. For this to work you must first select a folder to store the procedure in. You will be prompted for a name for the new procedure. The Code Pane and Comment Panes are cleared, ready for input of the new code and comments. The addition will be saved as soon as you change to another procedure.

This command is available only in Treeview.

Add Folder

This will insert a new folder in the Codetainer database. For this to work you must first select a parent folder for the new folder. You can also create a new folder directly under the "Routines-cardbox". You will be prompted for a name for the new folder. Once created you can create sub-folders and store procedures in the new folder.

This command is available only in Treeview.

Delete

This will delete the currently selected procedure or folder. If you delete a folder all sub-folders and procedures stored in the folder or its subfolders are also deleted. Be careful with this command. You will not be prompted or warned before the delete takes place. Also, the delete can not be undone.

This command is available only in Treeview and Search View.

Copy Procedure to Database

This will copy the current content in the Code Pane from the open module to the Codetainer database. You will be prompted for a name for the new procedure. You can choose the default name or enter a new name.

The new procedure will be stored in the current folder in Treeview. This means that you would want to select a folder in Treeview before you use this command. It also means that the command will not work if you have selected a procedure in Treeview.

This command is available only in Module view.

Copy Code

This will copy the current content in the Code Pane to the Windows clipboard.

Cut, Copy and Paste

The Cut command will move the selected text from the current text pane to the Windows clipboard. It will work only if the Code Pane or a Comment Pane is active.

The Copy command will copy the selected text in the current text pane to the Windows clipboard. It will work only if the Code Pane or a Comment Pane is active.

The Paste command will copy the content of the Windows clipboard to the current text pane. It will work only if the Code Pane or a Comment Pane is active. The command will only paste text from the clipboard, not other objects such as pictures.

Find and Find Next

Find will prompt you for a word or phrase to search for. Find will search the names of the procedures in the current view. The search is case sensitive.

Find next will find the next occurrence of the sought word or phrase.

Search

Search will prompt you for a word or phrase to search for. The program will then perform a search in the entire Codetainer database, except for the folder-names. The result of the search is displayed in Search view. Codetainer will automatically enter Search view after the search is completed.

Search does not use boolean operators (and, or, not etc.) for its search and you cannot combine two or more criteria. All text entered in the Search dialog is treated as one string or phrase and the search will be made for the entire string.

Project

Insert Procedure in Module

This will insert the text currently displayed in the Code Pane of Codetainer at the beginning of the current code pane of Visual Basic IDE (VBIDE). This is all you have to do to paste code stored in Codetainer into a project in Visual Basic.

The code is placed immediately after the declaration section of the VBIDE code pane. This means that you can store and paste declarations just as easy as normal procedures. The declarations are put in the right place, at the end of the declaration section.

Help

Help

This will display the Codetainer help file.

About Codetainer

Displays version and copyright-information.

Codetainer © Copyright 1997-1998 Magnus Brorsson

Copyright law and international treaties protect codetainer. Unauthorized reproduction or distribution of Codetainer, or any portion of it, may result in severe civil and criminal penalties and will be prosecuted to the maximum extent possible under law.

Distribution in accordance with the License Agreement (i.e. Shareware distribution) is not prohibited.

 

Shareware and copyright

The Shareware Version of Codetainer is not limited in any way. The only limitations are your hardware and the limitations of the JET engine. However, Codetainer is shareware, not freeware. This means you must adhere to the license agreement. You may try Codetainer out for a trial period of 30 days. After that trial period you are requested to pay a license fee of SEK 200 or USD 35 to

Magnus Brorsson

Stromstarevagen 3

S-134 42 Gustavsberg

SWEDEN

Please provide your name, address and e-mail address.

Codetainer is a trademark owned by Magnus Brorsson. Windows and Visual Basic are trademarks belonging to Microsoft Corporation.

Technical Support

Codetainer is a hobby project and technical support is available only to a very limited extent. Registered user may send e-mail questions to magnus.brorsson@mailbox.swipnet.se. Questions from registered users will be answered if time allows. Information about possible future major upgrades and bug-reports might be sent by e-mail to registered users.

Also check out the Codetainer homepage at http://home3.swipnet.se/~w-38279/codetainer/codetain.htm.

 

Codetainer License Agreement

1. This shareware software may be freely distributed provided that:

a) Such distribution includes only the original archive (Codetainer.zip). You may not alter, delete or add any files in the distribution archive.

b) No money is charged to the person receiving the software, beyond reasonable cost of packaging and other overhead.

2. By installing Codetainer you accept the following User Agreement. This agreement is a binding legal agreement between Magnus Brorsson and the person installing the software. If you do not intend to honor this agreement, immediately exit the installation program or, if the software has already been installed, remove all installed Codetainer files from your computer.

3. You may evaluate the Shareware program for a maximum of thirty calendar days. After the expiration of the evaluation period you must pay the license fee of SEK 200 or USD 35, or remove the software from your computer.

You may allow other users to evaluate copies of the unregistered Shareware. All evaluation users are subject to the terms of this agreement.

You are not allowed to attempt to reverse engineer, disassemble or decompile Codetainer software.

4. The Codetainer name and any logo or graphics file that represent the Codetainer software may not be used in any way. All parts of Codetainer are copyright protected. No code, program, part, image or text may be copied or used in any way by the user except as intended within the bounds of the single user program.

5. You will indemnify, hold harmless, and defend Magnus Brorsson against any lawsuits, claims and costs associated with defense or accusations that result from your use of Codetainer.

6. MAGNUS BRORSSON IS NOT RESPONSIBLE FOR ANY DAMAGES WHATSOEVER, INCLUDING LOSS OF INFORMATION, INTERRUPTION OF BUSINESS, PERSONAL INJURY AND OR ANY DAMAGE OR CONSEQUENTIAL DAMAGE WITHOUT LIMITATION, INCURRED BEFORE, DURING OR AFTER THE USE OF CODETAINER. MAGNUS BRORSSON'S ENTIRE LIABILITY, WITHOUT EXCEPTION, IS LIMITED TO THE CUSTOMER'S REIMBURSEMENT OF THE PURCHASE PRICE OF THE SOFTWARE (MAXIMUM BEING THE REGISTRATION FEE PAID TO MAGNUS BRORSSON) IN EXCHANGE FOR THE RETURN OF THE PRODUCT, ALL COPIES, REGISTRATION PAPERS AND MANUAL, AND ALL MATERIALS THAT CONSTITUTE A TRANSFER OF OWNERSHIP FROM THE CUSTOMER BACK TO MAGNUS BRORSSON.

7. Each egistered copy of Codetainer may be used in only one single location by one user. Use of the software means that you have loaded the program and run it or have installed the program onto a computer. If you install the software onto a multi-user platform or network, each and every indiviual user of the software must be registered separately.

8. You may make one copy of the registered software for backup purposes, providing you only have one copy installed on one computer being used by one person. If any person other than yourseld uses Codetainer software registered in your name, regardless of whether it is at the same time or different times, then this agreements is being violated.

9. Except as specifically allowed under this agreement, the sale of and or distribution of registered copies of this software is strictly forbidden. It is a violation of this agreement to loan, rent, lease, borrow or transfer the use of registered copies of Codetainer.