Loading Code Snippets Database Take 2...

Code Snippets Database – Take 2 [v]

Welcome to the Code Snippets Database Take 2

This web application acts as a viewer for the DelphiDabbler Code Snippets Database.

By default the snippets are grouped by category in the left hand pane of the window. Click a category name to see a list snippets in the category.

Click a snippet name to display its details in this pane.

You can display snippets alphabetically, grouped by initial letter by clicking the Alphabetical button. Alternatively snippets can be grouped by kind (e.g. routines, constants) using the Snippet kind button. Use the Categorised button to return to the default category grouping.

Compilable Pascal units can be generated that contain selected snippets. Before trying to generate a unit you need to select the snippets you want included.

Selected snippets are indicated by little blue vertical "pins" that are displayed alongside the snippet's name in the left hand pane. Snippets can be selected in several ways:

  • Click on the "pin" beside the snippet's name to toggle it on (vertical blue pin) and off (grey horizontal pin).
  • Click on the "pin" that is displayed in a group heading in the left hand pane. If the pin is vertical clicking it will select all the snippets in the group while clicking a horizontal pin will de-select the snippets.
  • Use the Select button in the toolbar and select one of the options that are displayed in the drop-down list that is displayed:
    • The Pin All Snippets option selects all the snippets in the database.
    • The Clear All Pins option de-selects all the snippets in the database.
    • The Select By Compiler option enables you to select only those snippets that can be used with a given compiler.
      A dialogue box is displayed where you select the required compiler and chose how snippets are to be chosen.
      Select the Include only snippets known to compile radio button and only snippets that are flagged in the database as being compatible with the chosen compiler will be selected.
      Choosing the other radio button selects both the snippets known to compile and those for which no compile information is available, i.e. only those snippets known not to compile are excluded.

Once some snippets have been selected you can click the Generate Unit button. This displays a dialogue box where a suitable unit name must be entered. Clicking Generate Unit button in the dialogue box now causes the unit to be generated. The source code is displayed inside a text box to make it easy to copy and paste the code into a suitable file. Note that on some browsers the text in the text box will already be selected for you.

The Reload button re-loads the database to reflect any changes since the app was displayed. It also reverts to a categories grouping of snippets in the left hand pane. There should rarely be any need to use this button unless you know the database has been updated. All "pins" are cleared.

Note: This is a beta release. Please report any bugs.

If you use Windows you can also use the DelphiDabbler CodeSnip code snippets repository program to view this database and to maintain your own snippets.

Version

License

Copyright © 2012-2014, Peter Johnson, http://delphidabbler.com.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

This software uses the following 3rd party code: