# QuickStart Guide

This is a guide to getting up and running quickly with CodeSnip.

## Install the DelphiDabbler Snippets database

If you have not already done so, you can install the main DelphiDabbler Code Snippets database. You may be prompted to download the database the first time you run the program.

## Customise the Database

You can add your own snippets to the database. These snippets are held separately to the main database and are not affected by database updates.

Add, edit and delete snippets using the appropriate menu items on the Database menu. You can also save, backup and restore the user database from this menu.

Snippets can be categorised using any of the available categories or you can defined your own.

## Navigating the database

All the snippets in the database are displayed in the Overview Pane, grouped in different ways depending on which tab is selected. Select the name of a snippet in the Overview Pane to display its source code, description and other information in the Detail Pane.

For Pascal snippets any snippets required to compile the displayed snippet are listed in the "Required snippets" section. Clicking a snippet's name displays its details. Similar snippets are accessible in the "See also" section. The compilers the snippet is known to compile with are indicated at the bottom of the display.

Clicking a section heading in the Overview Pane displays a table listing all the snippets in that section in the current tab of the Detail Pane. Clicking any snippet name will display the snippet's details in a similar way.

Items in the Overview Pane can be displayed in a new tab in the Details Pane either by Ctrl-clicking the item or by creating a new, empty tab by pressing Ctrl+T before clicking the required item.

## Searching the database

You can search the database for specific words, for Pascal snippets that compile (or don't compile) under certain compilers or for cross-referenced snippets. Use the Find Text, Find Compiler(s) or File Cross References dialogue boxes to perform a search. These dialogues are accessed via the Search menu.

When a search has been performed only those snippets that are found are listed in the Overview Pane. When a text search is performed the found words are highlighted in the detail pane.

The list of snippets resulting from a search can be stored in a file for later restoration. Use the Save Selection and Load Selection options from the File menu to do this.

To cancel a search and view all the database again, select the Search | Show All menu item.

## Favourite Snippets

If you have snippets that you return to frequently you can make them "favourites" by selecting the Snippets | Add To Favourites menu option or by pressing Shift+Alt+F when the snippet is displayed.

Favourite snippets are displayed in the Favourites dialogue box which is accessed from the Snippets | Show Favourites menu option or by pressing F4. Display the snippet you want by double clicking it. The snippet will then be displayed in the main window's detail pane in a new tab. You can also use the dialogue box to remove any unwanted favourites.

The Favourites dialogue box is non-modal and can be left displayed alongside the main CodeSnip window for easy access to favourites. By default the dialogue box fades to semi-transparency when the main window is being used, but this can be changed if desired.

## Test Compiling Snippets

When any Pascal snippet is selected you can test it with any supported compilers currently installed on your computer, provided it is not a freeform snippet. To do this you must first have configured CodeSnip to work with your compilers by providing the required information in the Configure Compilers dialogue box.

To perform a test compilation select the required snippet in the Overview pane and choose Compile | Test Compile Snippet menu option or press F9. The program will then compile the snippet and display the result in the Test Compile Results dialogue box. Full details of any compiler errors or warnings can be displayed from this dialogue box.

## Exporting Snippets

CodeSnip can export snippets or complete units, as follows:

- Any selected routine or routines in a selected category can be exported to a file using the Save Annotated Source dialogue box accessed from the File | Save Annotated Source menu option.
- Plain text and syntax highlighted rich text copies of selected snippets can be copied to the clipboard via the Edit | Copy Annotated Source (routines only) or Edit | Copy Source Code menu options.

- Complete Pascal units can be generated and written to file. The unit will contain all the currently selected snippets (i.e. those displayed in the Overview Pane). You can explicitly specify the selected snippets by using the Select Snippets dialogue box available via the Search | Select Snippets menu option.

  The unit is configured and saved from the Save Unit dialogue box, displayed from the File | Save Unit menu option.

  Note that unit and freeform snippets cannot be included in a generated unit.

- User-defined snippets can be exported to a file that can be imported by other CodeSnip users.