new file template

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
wolivo
Posts: 6
Joined: Wed Feb 16, 2005 7:38 pm

new file template

Post by wolivo »

I just upgraded to 3.96a and noticed that when I create a new file based on a template, I get only 12 lines of the template file. Is there a line limit now? Are there any characters that would force the new document function to quit reading the file?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

I just upgraded to 3.96a and noticed that when I create a new file based on a template, I get only 12 lines of the template file. Is there a line limit now?
No.
Are there any characters that would force the new document function to quit reading the file?
I suspect a bug might have been introduced into this latest version, but unfortunately I could not reproduce the error :(

As a test I uses the Zeus file new template:
c:\Program Files\zeus\zExample\filenew.tpl
but for me this created a new file some 45 lines long.

Can you send me your template file :?:

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi wolivo,

This bug should be fixed in the latest Zeus patch: http://www.zeusedit.com/forum/viewtopic.php?t=1050

This release also provides more control of templates by allowing expansions and macros to be run from within the template.

For example in the Default Document Type there is the following New File template:

Code: Select all

$MacroExcute<$zdzscript\file_create.lua|!0>
$ExpandTemplate<$zdzexample\filenew.tpl>
This template shows how to embed a macro and an expansion into the template. Also take note of the new |!0 (or alternatively |=0) return check feature.

The file_create.lua macro calls set_return_code to provide a return code value and as is the case with this example, the template expansion checks this return code and cancel the expansion if the value is not zero.

To run this template just click on the New File Template found in the Templates section of the navigator ;)

Cheers Jussi
Post Reply