<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<!--
 * $Rev$
 * $Date$
 *
 * ***** BEGIN LICENSE BLOCK *****
 *
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with the
 * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 *
 * The Original Code is task_generateunit.htm
 *
 * The Initial Developer of the Original Code is Peter Johnson
 * (http://www.delphidabbler.com/).
 *
 * Portions created by the Initial Developer are Copyright (C) 2006-2010 Peter
 * Johnson. All Rights Reserved.
 *
 * Contributor(s):
 *   NONE
 *
 * ***** END LICENSE BLOCK *****
-->
<html>
  <head>
    <meta http-equiv="Content-Type" content="text-html; charset=Windows-1252">
    <title>
      Generate Unit
    </title>
    <link rel="stylesheet" href="../css/codesnip.css" type="text/css">
  </head>
  <body>
    <h1>
      <a name="task_savesnippet"></a>Generate a Pascal Unit
    </h1>
    <p>
      You can generate source code for a Pascal unit and save it to disk as
      follows.
    </p>
    <ol>
      <li>
        Select the snippets you want to include in the unit. The easiest way to
        do this is to use the
        <img
          src="../Images/SelectRoutines.gif"
          class="glyph"
          alt="Select Snippets button"
        > toolbar button (or select <em>Search | Select Snippets</em>) then
        select the routines you require in the
        <a href="dlg_selectroutines.htm">Select Snippets</a> dialog box. (Note
        that you can also select snippets using any of the program's search
        options – see the <a href="task_search.htm">Search Database</a>
        task for more information).
      </li>
      <li>
        Click the
        <img
          src="../Images/SaveUnit.gif"
          class="glyph"
          alt="Save Unit button"
        > toolbar button or choose the <em>File | Save Unit</em> menu option.
      </li>
      <li>
        Enter the name of the unit in the <a href="dlg_saveunit.htm">Save Unit
        dialog box</a>. Ensure that the file name you select (without extension)
        is a valid Pascal unit name.
      </li>
      <li>
        Choose the file type, the commenting style and whether you want the
        file syntax highlighted using the controls in the dialog box. You can
        preview the file by using the dialog box's <em>Preview</em> button.
      </li>
      <li>
        Click <em>OK</em> to generate the unit.
      </li>
    </ol>
    <p>
      See the <a href="dlg_savesnippet.htm">Save Unit dialog box</a> help topic
      for detailed information about the available options.
    </p>
    <p>
      Whether certain warnings are inihibited in the generated code can be
      specified using the <a href="dlg_prefs_codegen.htm">Code Generation</a>
      tab of the <a href="dlg_preferences.htm">Preferences dialog
      box</a>. The default commenting style, syntax highlighting and file type
      can be also be configured using the
      <a href="dlg_prefs_sourcecode.htm">Code Formatting</a> tab.
    </p>
    <p>
      <a href="snippet_freeform.htm">Freeform</a> snippets cannot be included in
      a unit. Any freeform snippets included in the current selection will be
      ignored.
    </p>
  </body>
</html>