CodeSnip Code Snippets Repository
|Date:||15 May 2013|
|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, Windows 8, Windows 2012 Server|
CodeSnip is an open source code bank for storing and viewing code snippets. It not only manages, displays and manipulates your own code snippets but it can also incorporate snippets downloaded from the online Code Snippets database.
Snippets can be displayed by category, alphabetically or by type. Full details of a selected snippet are displayed [see screenshot 2]. The details displayed include:
Designed with Pascal in mind, CodeSnip enables Delphi or Free Pascal code snippets to be test-compiled with any installed version of those compilers. Results are reported as shown in [see screenshot 4]. Use this feature to validate the syntax of code without having start your compiler's IDE.
Code in other languages can be stored in CodeSnip although the source file generation and compiler checking features will not be available.
The database can be searched for snippets that contain specified text, for cross referenced snippets. The snippets to be displayed can also be selected manually. In addition you can search for Pascal snippets that compile under given versions of Delphi or Free Pascal.
Frequently used snippets can be marked as "favourites" for quick access.
CodeSnip can generate and export Pascal 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.
- Selected snippets can be exported to files that can be shared with other CodeSnip users.
Units and Pascal include files can also be exported as syntax highlighted XHTML or srich text files. The Pascal syntax highlighter can be customized.
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.
There are a couple of ways to get news about changes to this program and to the online database:
- Subscribe to the Code Snippets News Feed to get news of changes delivered to your news reader or browser.
- Every time you update the database from CodeSnip the latest news is displayed in the Update From Web dialog box.
The DelphiDabbler wiki has a FAQ that answers questions about using 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. If you create any useful new features please advise me so that I can consider incorporating the changes into CodeSnip.
CodeSnip will automatically detect bugs that raise unexpected exceptions and will display a bug report dialog box. 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. 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.