[Templates] subtracting one
Csongor FAGYAL
concept at conceptonline.hu
Sat Jul 19 23:33:44 BST 2008
Hi,
> I get a parse error with [% series.year - 1 %]. According to the thread
> at
> http://www.mail-archive.com/templates@template-toolkit.org/msg05821.html
> , it is because it is being interpreted as a negative 1 instead of an
> operator.
>
>
>
> What's the workaround? I've tried:
>
>
>
> [% series.year - (1) %]
>
> [% series.year + -1 %]
>
> [% one = 1; series.year - one %]
>
>
>
> all to no avail.
This does not work for me:
[% SET x=1 %]
[% SET y=x-1 %]
[% GET y %]
But this works:
[% SET x=1 %]
[% SET y=x+-1 %]
[% y %]
This is also good:
[% SET x=1 %]
[% SET y=-1+x %]
[% y %]
- Fagzal
--
http://csongor.fagyal.com
More information about the templates
mailing list