[Zope] Comparing "unsized objects" and strings
Thomas Weiner
weiner@tu-harburg.de
Mon, 06 Mar 2000 19:15:00 +0100
Christian Selig schrieb:
[...]
> Okay, no problem so far. But when I want to compare the value to a
> parameter I have given to the document via a <FORM>:
>
> ---snip
> <dtml-in "externalMeth(p)">
> <dtml-var aid> <!-- Okay, works fine of course -->
> <dtml-if "aid == param">
> Hi there!
> </dtml-if>
> ---snap
>
> The expression evaluates always to false. I have traced the problem back
> with an external method ("<dtml-if "equals(aid, param)">"). When trying
> the "len" function on both variables, "param" is not a problem (it's a
> string from the the <FORM>), but "aid" complains that it was an "unsized
> object".
>
> How do I compare them?
hmm .. untested:
<dtml-if "_.str(aid)==param">
_.str(aid) should return a string presentation of aid.
hth,
Thomas