Hi to all,

I need small help in this problem, this the continuation to previous.

[% FOREACH st IN university %]
[% st.name %]
[%st.location%]
studentdata:
[% FOREACH student IN st.branch.electronics.student %]
Component type: [%+ student.name +%][%+ student.number +%]
        [% FOREACH add IN studentaddress.adress %]
       [% IF adress.name==student.name && adress.number ==student.number %]
       [% adress.address %]
 [% END %]
 [% END %]
 [% END %]

by using the script I am comparing values in two keys in a hash and is same
the get the address. I am printing  it workings but my problem is if i have
two or three address for same student, so i placed coma and printing like
this using this line

 [% adress.address %] ,

it printing    address1, address2, address3,   like that but i need to
print like this

if I have three address I need to print like this
 address1, address2 or address3.
if I have two address I need to print like this
 address1, address2.
if I have one address I need to print like this
 address1.

any body can help me in the script what should I have to do to print like
this.
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to