RAD Studio (Common)
ContentsIndex
PreviousUpNext
Creating Live Templates

While using the Code Editor, you can add your favorite code constructs to the Template Manager to create a library of the templates you use most often.

To add a Live Template using the Menu Commands

  1. While you are working in the Code Editor, choose FileNewOtherOther Files and then select the Live Template icon.
  2. Fill in the template name, description, author, and code language attributes. Then type in the code for your template between the <![CDATA[]]> tag and the </code> tag.
    Note: The Name
    and Language fields in the template are required.
  3. Choose the Save command from the File pull-down menu in the Code Editor (or type CTRL + S). Your new template now appears in the IDE tree of the Template Manager window. It is saved, by default, into the \5.0\Objrepos\code_templates\ directory.

To add a Live Template using the Template Manager window

  1. In the Code Editor, choose ViewTemplates.
  2. In the Template Manager window, click the New button. This will put an XML outline for a code template in the Code Editor main window. You can also select code in the editor before you click the New button.
  3. Fill in the template name, description, author, and code language attributes. Then type in the code for your template between the <![CDATA[]]> tag and the </code> tag.
    Note: The Name
    and Language fields in the template are required.
  4. Choose the Save command from the File pull-down menu in the Code Editor (or type CTRL + S). Your new template now appears in the IDE tree of the Template Manager window. It is saved, by default, in the \5.0\Objrepos\code_templates\ directory.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!