| |||
| Home > Editing Source Code > Using templates > Inserting templates | |||
A template can be inserted into an empty File Editor pane or added to existing code. The insertion point is determined by the location of the cursor.
By default, RealView Debugger loads the template file installed as
part of the base product. This is called rvdebug.tpl,
and is located in the default settings directory (\etc).
However, you can create and use your own template files if required
(see Creating templates).
To insert a template:
Open the file to be changed into the File Editor pane.
Position the text insertion point at the required location and select Edit → Insert Template....
This displays the Insert Template dialog box showing the currently available template file and the templates it contains, shown in Figure 11.4.
If you have created your own template file, use the Load... button
to locate and load a different template file, for example my_template.tpl.
Highlight the required template in the list and click Show to display a text box showing the contents of the chosen template.
Click Close to close the definition display.
Highlight the required template in the list and click Insert to paste the template into the current source code in the File Editor.
The chosen template is displayed and any variables are automatically updated.
When all the required templates have been included, close the Insert Template dialog box and save your modified source code.
RealView Debugger provides several ways to edit template files:
Edit template files from the Insert Template dialog box, shown in Figure 11.4. Click Edit... to display the template file in the File Editor pane ready for editing.
Load a template file directly into the File Editor pane without going through the Insert Template dialog box.
Create and edit template files using any text editor.