I have the requirement of doing something equivalent to [% FOR i=0; i<SomeNumber;i =i+1 %] SomeText[% i %] [% END %]
Since Template toolkit does not have support for the [% FOR %] operator, I tried using a WHILE LOOP as follows ---------------------------------------------------- > cat config.tt [% numa=10 numb=20 %] ---------------------------------------------------- cat t.tt [% numa %] [% WHILE numa > 0 %] SomeText[% numa %] [% numa -= 1 %] [% END %] ---------------------------------------------------- Executing tpage gave the following error ---------------------------------------------------- > tpage --preprocess=config.tt t.tt file error - parse error - t.tt line 5: unexpected token (=) [% numa -= 1 %]Exit 9 ---------------------------------------------------- Any suggestion on what I am doing wrong and how to fix it? Regards Vijay
_______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
