# Save Annotated Source Dialogue Box

This dialogue box is displayed when the File | Save Annotated Source menu option is clicked. It is used to specify the required file name, type and formatting information for the routine snippet or category that is to be saved.

The saved code includes comments noting the units and any other snippets from the database that are required by the saved routine(s).

The output file contains the source code of the currently selected routine snippet or category. If a category is selected its contained routines are included in the output file, but any non-routine snippets are ignored.

The dialogue is a standard Windows save dialogue box with a few added options.

You specify the name and folder for the file in the usual way.

Use the Save as type drop down list to specify the type of file to be saved. Options are:

- A Pascal include file (.inc) – The code is written to a file with extension .inc that can be included in any Pascal source file. The file should be valid for inclusion in a Pascal unit using the `$INCLUDE` (or `$I`) directive.
- A plain text file (.txt) – This is the same as the Pascal include file except that the extension is .txt rather than .inc.
- An HTML file (.html) – This option writes the source code out as a valid XHTML document that uses embedded CSS to format the code. The source code will be syntax highlighted if the Use syntax highlighting check box is checked.
- A rich text file (.rtf) – The source code is written out as an RTF document. Again syntax highlighting can be used if the Use syntax highlighting check box is checked.

Snippet descriptions can be written as a Pascal comment to the output file. Use the Comment style drop down list to specify the style of commenting to be used. Such comments can be inhibited by selecting the No descriptive comments option from the list. If the Truncate comments to 1st paragraph check box is ticked then only the first paragraph of the snippet's description is used. Clearing this check box means that the full text of the description is used.

The output file encoding can be be specified in the File Encoding drop down list. Options vary depending on the file type. Some file types support only a single encoding. The encodings are:

- ANSI (Default) – the system default ANSI encoding. Available for both plain text and Pascal include files and as the only option for rich text files.
- UTF-8 – UTF-8 encoding, with BOM†. Available for both plain text and Pascal include files and as the only option for XHTML files. If used for Pascal include files be warned that the files will only compile with compilers that support Unicode source files.
- Unicode (Little Endian) – UTF-16 LE encoding, with BOM†. Available for plain text files only.
- Unicode (Big Endian) – UTF-16 BE encoding, with BOM†. Available for plain text files only.

The output can be previewed by clicking the Preview button. This displays the source code in a dialogue box, formatted according to your selections. Text in the preview can be selected and copied to the clipboard if required.

Use the Save button to write the file to disk or press Cancel to abort.

### Footnote

† BOM = Byte Order Mark or Preamble: a sequence of bytes at the start of a text file that identifies its encoding.