# Search the Database

You can search the code snippets database for text, by compiler or for cross-referenced snippets. You can also manually select which snippets are displayed.

Once a search is performed only those snippets matching the search criteria are displayed.

Text and compiler searches can be configured either to operate on any previous search results, effectively refining that search or to operate on the whole database, discarding any previous search results.

Cross reference searches and manual selections always operate on the whole database with any existing search results discarded.

Search results can be discarded by clicking the Show All toolbar button or by selecting Search | Show All. Following this all snippets are displayed.

## Text search

You can search for all snippets containing one or more words. Use the Find Text toolbar button (or select Search | Find Text) and enter the search text in the Find Text Dialogue Box.

## Compiler search

You can search for snippets that compile, fail to compile or that have not been tested on one or more compilers. Use the Find Compiler(s) toolbar button (or select Search | Find Compiler(s)) and enter the search criteria in the Find Compiler(s) Dialogue Box.

## Cross-reference search

This search is provided to enable you to find snippets that are related to one another. The search finds snippets that are referenced by the currently selected snippet. Cross references via the "see also" or "required snippets" fields can be searched, and searches can be recursive.

To run the search select a snippet in the Overview Pane then select Search | Find Cross Refs and configure the search in the Find Cross References dialogue box.

## Manual selection

Using the Select Snippets toolbar button (or selecting Search | Select Snippets) you can explicitly choose which snippets are to be displayed in the Overview Pane. This is done in the Select Snippets dialogue box by simply placing check marks next to the required snippets.

The main purpose of this option is to select snippets for inclusion in a generated Pascal unit. See the Generate Unit task for information about generating a unit.

## Saved Searches

The results of a search can be saved to disk using the File | Save Selection menu option. To restore the saved selection later use the File | Load Selection menu option and select the required search file. Loading a search always replaces any existing search results.

Note that the search criteria are not saved, just the details of the snippets that were included in the search results. If any snippets from a saved search result have been deleted by the time a result set is loaded then those snippets are quietly ignored.