
Hitachi Embedded Workshop User Manual
83
4.12
Templates
When developing software it is often necessary to enter the same text repeatedly, for instance, when typing a
function definition, for loop or a comment block for a function. The Hitachi Embedded Workshop editor allows
you to specify a block of text (or template) which can be inserted into the currently active editor window. Thus,
once a template has been defined, it can be automatically inserted without the need to re-enter it manually.
4.12.1
Defining a Template
To define a template:
1.
Select [Edit->Templates->Define Templates...], select [Templates->Define Templates...] from the
local menu, press CTRL+T or click on the define template toolbar button (
). The dialog shown in
figure 4.14 will be displayed.
2.
Click “Add”. A dialog is displayed that asks you to enter your chosen template name. This name must
be unique otherwise a duplicated template name message will be displayed and the template will not be
added.
3.
If you want to modify an existing template use the “Template name” drop down menu to select which
template you want to modify.
4.
Enter the desired text into the “Template text” text area. You can copy text from another editor window
and then paste it into this dialog using CTRL+V.
5.
Enter the following keywords to insert special information when the template is inserted:
Menu Entry
Placeholder
Replaced With
Time
$(TIME)
Current time
Date as DMY
$(DATE_DMY)
Current date, in dd/mm/yy form
Date as MDY
$(DATE_MDY)
Current date, in mm/dd/yy form
Date as YMD
$(DATE_YMD)
Current date, in yy/mm/dd form
Date as Text
$(DATE_TEXT)
Current date in text form
Line
$(LINE)
First line number of template insertion
User
$(USER)
Current windows user
File
$(FULLFILE)
Name of the file
Filename
$(FILE)
Name and full path of the file
Project Name
$(PROJNAME)
Current project name
Workspace Name
$(WORKSPNAME)
Workspace name
Cursor position
$(^)
Insertion cursor – Positions the cursor
in this position after template has been
inserted
6. Enter the $(^) character to specify where the insertion cursor is to be placed after the template has been
inserted. If this is not specified then the insertion cursor will be placed after the last character in the
template (as in a normal paste operation).