[Zope] stupid question I guess

Duncan Booth duncan@rcp.co.uk
Thu, 8 Jun 2000 16:19:47 +0000


> but I can't find the answer...
> 
> can I set a local variable in zope on a dtml page
> eg
> 
> <dtml-var variablename = 1>

I had a few thoughts on creating writeable local variables so I put 
them down in a HowTo. See
http://www.zope.org/Members/Duncan/LocalVars
for instructions on a different way to manipulate local variables in 
Zope. Basically, by addinga small python method, it lets you write 
code like:
 
  <dtml-with "locals(a=1, b='a string')" mapping>
     <dtml-var a> <dtml-var b>
     <dtml-call "set(a=3, b=b[:5])">
     <dtml-var a> <dtml-var b>
  </dtml-with>

and get:
   1 a string 3 a str 
as output.

-- 
Duncan Booth                                             duncan@dales.rmplc.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
http://dales.rmplc.co.uk/Duncan