Write Templates

The syntax for Templex statements is similar to that of the C programming language.

Examples of Templex statements and instructions for writing templates are provided in this manual, so a knowledge of C, while helpful, is not required.

Templates can contain plain text, Templex statements, mathematical expressions, constants, and variables. Templex statements, expressions, and variables must be placed between braces, { }. Any text outside the braces is treated as plain text and is not processed by Templex.

As Templex processes a template, the plain text is copied to the specified output stream exactly as it appears in the template. When Templex encounters an expression within braces, it evaluates the expression and sends the resulting value to the output text. If the item between the braces is a Templex statement, Templex carries out the statement instructions. If the Templex statement generates output, the resulting value is sent to the output text.

Templex has several statements for adding loops, if-then-else blocks, and file management functions to your templates. These programming constructs can be used to add flexibility to your templates.