[Zope] 'creating' a variable from sequence-item

Andreas Kostyrka andreas@mtg.co.at
Wed, 28 Jul 1999 20:54:44 +0200 (CEST)


On Wed, 28 Jul 1999, Tony McDonald wrote:

> Notes:
> 1) checked means the radio button is set, that stops problems with 
> variables such as 'answern' not being defined. Pedagogically, it's an 
> open call whether you should assume the student doesn't know to begin 
> with :)
> 2) numquestions:int stops problems with the numquestions+1 code a bit later on.
> 
> Processing them is easy *if* I don't mind what order the keys are 
> displayed in...
> <dtml-in "REQUEST.form.items()">
> <dtml-var sequence-key> : <dtml-var sequence-item><BR>
> </dtml-in>
<dtml-in "range(numquestions)">
KEY: <dtml-var "'answer%d' % _['sequence-item']">
VALUE: <dtml-var "_['answer%d' % _['sequence-item']]">
</dtml-in>

> yikes! I *must* be doing something dumb here :)
Not really. You just encountered a thing that is seldom needed in standard
Zope I'd assume.

Andreas
--
Andreas Kostyrka                     | andreas@mtg.co.at
phone: +54/1/7070750                 | phone: +43/676/4091256   
MTG Handelsges.m.b.H.                | fax:   +43/1/7065299
Raiffeisenstr. 16/9                  | 2320 Zwoelfaxing AUSTRIA