[Zope] wrong value for integer variable?

Tony McDonald tony.mcdonald@ncl.ac.uk
Thu, 29 Jul 1999 09:56:03 +0100


At 4:27 pm -0400 28/7/99, Michel Pelletier wrote:
> > -----Original Message-----
>> From: Donald Holten [mailto:donner@biophysics.lanl.gov]
>> Sent: Wednesday, July 28, 1999 4:14 PM
>> To: michel@digicool.com
>> Cc: zope@zope.org
>> Subject: RE: [Zope] wrong value for integer variable?
>>
>>
>>	Something very interesting...  I changed the code as
>> you said, and, as I
>> sort of figured, it didn't work (only because I saw that
>> python has no way to
>> convert strings to ints). 
>
>Sure it does, int().  In DTML, you can access this via the _ namespace,
>ie.
>
><dtml-if "_.int('1') == 1">
>  Hey, it works!
></dtml-if>
>
>-Michel

There's also atoi, which uses an arbitrary base...I tried to use it 
so; and got an attribute error
<dtml-var "_.atoi('178')">
and
<dtml-var "_.atoi('178', 16)">
tone

------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2