New File Templates

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
Site Admin
Posts: 2491
Joined: Fri Aug 13, 2004 5:10 pm

New File Templates

Post by jussij »

Zeus provides a mechanism for creating a new file based on a predefined template. The template file can contain any free formatted text and/or any number of Zeus macro tags.

For example assume the text bellow is saved to the example.txt file in the Zeus install directory:

Code: Select all

$CompanyName - $Copyright

Author: $UserName

Date: $Date

Time: $Time

PTCS Details: $NewLine
              @format.use-tabs $UseTabs
              @format.indent-size $IndentSize
Next use the Options, Document Types menu to edit the default document type and add $zd\example.txt to the New File Template field found in the General panel.

Now selecting the File New menu will be produce the following text output:

Code: Select all



Date: 13/06/2006

Time: 09:44:11

PTCS Details: crlf
              @format.use-tabs false
              @format.indent-size 0
NOTE: The $CompanyName, $Copyright, $UserName macro tags get their information from Options, Editor Options menu, User Defines panel. In the example above they are not defined and hence the display above.

In the example above the template file was added to the default document type but it could just have easily been added to a specific document type.

The difference is when the template file is added to the Default Document Type then the template file will get run for all requests for a new file, where as if the file is added to a specific document type, the template is only run when a new file of that document type is requested.
Post Reply