[Zope] Newbie needs help
Passin, Tom
tpassin@mitretek.org
Mon, 3 Feb 2003 12:28:39 -0500
[ Michel Combe]
> What I want to do is display, from the result of an SQL=20
> query, each first occurence of a supplier name . ie : I have=20
> a query which returns for example "s1,s1,s1,s2,s2,s3,s3" and=20
> I want to display "s1,s2,s3".
>=20
> This is what I wrote :
> <dtml-let previous=3D"''">
> <dtml-in SQL_SelectSupplier>
> <dtml-if "SupplierName!=3Dprevious">
> <p>Found First</p>
> <dtml-else>
> <p>Found Next</p>
> <dtml-let previous=3DSupplierName></dtml-let>
> </dtml-if>
> <dtml-in>
>=20
> It doesn't work and I can't find why...
> Thanks for your help
>=20
You have gotten some solutions but they have not answered the part 'I
can't find out why...'. The reason is that assignments made using
dtml-let only exist within the scope of that dtml-let. IOW, they are
not assigned to the whole page but only to that part of the code. Your
second assignment to "previous" will not change the earlier definition
of "previous".
Cheers,
Tom P