Unit pastemplate

Uses
Classes, Interfaces, Objects and Records
Constants
Variables

Description

Simple pascal template

Overview

Functions and Procedures

function convertTemplate(s: string; special: TSpecialCallBack): string;

Types

TSpecialCallBack = function (name: string): string;

Description

Functions and Procedures

function convertTemplate(s: string; special: TSpecialCallBack): string;

Parses a simple pascal template.


It may contain the following commands:
{%REPEAT x, [a, b, c, ..]} .. {%END-REPEAT}
Creates several copy of the text between REPEAT and END-REPEAT while replacing x by a in the first copy, x by b in the second, ...

{%REPEAT (x, y), [(a1, a2), (b1, b2), ...]} .. {%END-REPEAT}
Creates several copy of the text between REPEAT and END-REPEAT while replacing x by a1 and y by a2 in the first copy, x by b1 and y by b2 in the second, ...

{%REPEAT} .. {%END-REPEAT}
Removes the text between REPEAT and END-REPEAT (i.e. make exactly zero copies)

{%COMPARE x =/<> y} .. {%END-COMPARE}
Only inserts the text if x=y or x<>y. Its just comparing the trimmed text

{%SPECIAL:foobar}
Calls an external callback function with the value foobar

}

Types

TSpecialCallBack = function (name: string): string;
 

Generated by PasDoc 0.16.0.