Hi, can someone tell me how I could change this so that it prints out 27 characters? <dtml-in "_.range(28)"> <dtml-var "_.chr(sequence-index)"> </dtml-in> Thanks for your time. josh oN
On Wed, 10 May 2000, josh on wrote:
Hi,
can someone tell me how I could change this so that it prints out 27 characters?
<dtml-in "_.range(28)"> <dtml-var "_.chr(sequence-index)"> </dtml-in>
<dtml-in "_.range(28)"> <dtml-var "_.chr(_['sequence-index']+32)"> </dtml-in> The thing is if you embrace sequence-index in "" zope'll try to calc sequence minus index... and so you need to enclose the var name in _['varname']. Plus 32? coz this way they are ascii printable chars ;) ---- Carlos Neves cneves@ruido-visual.pt
The thing is if you embrace sequence-index in "" zope'll try to calc sequence minus index... and so you need to enclose the var name in _['varname']. Plus 32? coz this way they are ascii printable chars ;)
Or if what you want is: 0 1 2 3 4 ... 27 Then just: <dtml-in "_.range(28)"> <dtml-var sequence-index> </dtml-in> will work. If you want: 1 2 3 4 5 ... 28 Then try: <dtml-in "_.range(1,29)"> <dtml-var sequence-index> </dtml-in> --jfarr "Perl is worse than Python because people wanted it worse." Larry Wall, 14 Oct 1998
On Wed, 10 May 2000, josh on wrote:
can someone tell me how I could change this so that it prints out 27 characters?
You cannot - it'll print 28. :)
<dtml-in "_.range(28)"> <dtml-var "_.chr(sequence-index)"> </dtml-in>
<dtml-in "_.range(28)"> <dtml-var "_.chr(_['sequence-index'])"> </dtml-in> Oleg. (All opinions are mine and not of my employer) ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
participants (4)
-
Carlos Neves -
Jonothan Farr -
josh on -
Oleg Broytmann