Page 1 of 1

new file template

Posted: Fri Jan 26, 2007 4:48 pm
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?

Posted: Sun Jan 28, 2007 10:43 pm
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

Posted: Wed Feb 07, 2007 11:50 pm
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