Sum value only Odd page ( Additional barcode)

Hi ,
i try to to develop the addtional barcode with the value a will +1 in every odd page.May i know is it possible i can do this logic inside condition ?
var a =0;
a = a+1;

Hi,
There is no need for an additional counter.
For duplex, you could use ${sheet.nr-1} or , for simplex ${page.nr-1}.
The output engine is doing the incrementing for you.