CodeSnip Code Snippets Repository

   
Release: 3.9.3
Date: 23 November 2011
O/S: Windows 95, Windows 98, Windows Me, Windows NT 3.1, Windows NT 4, Windows 2000, Windows XP, Windows 2003 Server, Windows Vista, Windows 2008 Server, Windows 7, Windows 2008 Server R2

Overview

CodeSnip 4 Preview Available
The first (alpha) preview of CodeSnip has been released. This release illustrates some of the program's new features.
You can get the preview program from SourceForge. Just choose the file you require from the Release-4.0.0-alpha.1 directory.
This is an early preview, so don't trust valuable data to it. You should carefully read the v4 Preview ReadMe file before installing.
SourceForge.net symbol
Softpedia 100% Free symbol

CodeSnip is an open source program that can be used to manage, display and manipulate a source code repository. The repository can display locally stored snippets downloaded from the online Code Snippets database as well as user-defined code snippets. User defined snippets can be edited, backed up and shared with other users.

Snippets can be displayed by category, alphabetically or by type. Full details of a selected snippet are displayed [see screenshot 1]. The details displayed include:

  • A brief description of the snippet.
  • Syntax highlighted source code.
  • A list of required Delphi units.
  • A list of other snippets from the database that are required by the snippet.
  • Details of which version of Delphi or Free Pascal can compile the snippet.
« Please Contribute to the Database »
Have you got some useful utility routines, constants or types? Are you happy to place them in the public domain for others to use? If so then please submit your code for inclusion in the code snippets database.
If you have CodeSnip v2.2 or later you can submit code using the Database | Submit Routines (v2) or Database | Submit Snippets (v3) menu item. Users of earlier versions must send code to me via the contact page.

The database can be searched for snippets that contain specified text, for cross referenced snippets or for snippets that compile under specified versions of Delphi. In addition the snippets to be displayed can be selected manually.

CodeSnip can generate and export source code in various ways:

  • Compilable Object Pascal units containing selected snippets from the database can be generated and written to file.
  • Individual routines or whole categories can be written to Object Pascal include files or copied to the clipboard for including in Delphi and FreePascal projects.
  • Information about snippets can copied or printed.

Units and include files can also be exported as syntax highlighted XHTML or rich text files. The syntax highlighter can be customized.

CodeSnip can also test compile suitable snippets with Delphi 32 bit compilers from version 2 to XE2 and the Free Pascal Compiler. The results of the compilation can be displayed [see screenshots 2 & 3]. Compilers must be installed on the local computer and CodeSnip must be told where they are located before it can use them in test compilations. You can customize the command line switches that are passed to the compilers.

Updating the Database

The main database can be updated using the Database | Update From Web menu option. CodeSnip connects to a web service and downloads any updates. News items are displayed in the update dialog that provide information about the latest updates to the database and to CodeSnip.

The update web service will not work with some beta versions of CodeSnip and nor will it work with v2.0. If you are still using one of these versions please update.

CodeSnip can be configured to use a proxy server when updating the database.

CodeSnip News

There are a couple of ways to get news about changes to this program and to the online database:

  1. Subscribe to the RSS feed iconCode Snippets News Feed to get news of changes delivered to your news reader or browser.
  2. Every time you update the database from CodeSnip the latest news is displayed in the Update From Web dialog box.

FAQ

The DelphiDabbler wiki has a FAQ that answers questions about using CodeSnip.

Improving CodeSnip

Suggestions for new features are always welcome – please use the Feature Request Tracker on SourceForge to submit feature requests.

Because CodeSnip is open source you can download the source code and make modifications yourself. Get the source from the code repository on SourceForge. If you create any useful new features please advise me so that I can consider incorporating the changes into CodeSnip.

Reporting Bugs

Known bugs and fixes are maintained by the CodeSnip Bug Tracker on SourceForge. A list of bugs fixed before moving to the bug tracker on 28th September 2009 can be seen on the Bugs tab.

CodeSnip will automatically detect bugs that raise unexpected exceptions and will display a bug report dialog box if any such bugs occur. Any other bugs can be reported by selecting the Tools | Report Bug Online menu option. In either case you will be taken to the bug tracker on SourceForge. Please provide as much information as you can about the bug – I can't fix it without a comprehensive description.

Demo Program and Test Code

Bill Miller of Adirondack Software & Graphics has written a program that demonstrates most of the snippets in the Code Snippets Database. More Info.

Source code of some tests for selected snippets from the database is available as part of the Delphi Doodlings repository on Assembla.com. The code can be found in the CodeSnippets sub-directory of the trunk.