[Zope] Storing integers...

Martijn Pieters mj@antraciet.nl
Tue, 03 Aug 1999 11:12:51 +0200


At 00:33 27/07/99 , Donald Holten wrote:
>         Hi!  I was wondering if there was a way to alter the command:
>         <!--#call "REQUEST.set('numruns',GetRuns())"-->
>         to make numruns an integer instead of a string.  Thanks!
>         Donner

If GetRuns() returns an integer, it will be stored as an integer.

If GetRuns returns a string that can be read as a number (i.e. '12', which 
is a string with the characters '1' and '2'), you can use _.string.atoi() 
to convert the string to an integer:

<!--#call "REQUEST.set('numruns', _.string.atoi(GetRuns()))"-->

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------