To better understand how templates work, run the following test:
- File New menu to create a new file
- File Save As menu and save the file to c:\temp\test.c
- Type in foi<space or enter> and move the cursor to the end of the file
- Type in while<space or enter> and move the cursor to the end of the file
- Type in ife<space or enter> and move the cursor to the end of the file
- Type in File Save As menu and save the file to c:\temp\test.txt
- Type in foi<enter> and move the cursor to the end of the file
- Type in while<enter> and move the cursor to the end of the file
- Type in ife<enter> and move the cursor to the end of the file
While the file was named c:\temp\test.c the foi, while and ife where expanded to read as follows:
Code: Select all
for (int i = 0; i < ; ++i)
{
}
while ()
{
}
if ( == )
{
}
Code: Select all
foi
while
ife
The Zeus configuration model makes it possible to define templates that work within the scope of a given file or alternatively, it is also possible to define the same template to produce a totally different results depending on the file being edited.
It is also possible to define a template to have global scope meaning it will work for all file types. This is done by defining the template in the Default Document Type.
As an example of such a template, repeat the test above but this time use the dte date time template.