[Zope] 2d list manipulation
Sat, 09 Sep 2000 15:43:55 -0500
At 03:40 PM 9/9/00 -0500, Tim Russell wrote:
>That's the thing -- It doesn't give any errors, it just doesn't have any
>effect on the value in the array. Weird, no?
> > >Nope, still nothing...
> > >
> > > > > <dtml-call "REQUEST.set('col[index1][index2]', 5)">
> > > >
> > > > Just try it without the single quotes:
> > > >
> > > > <dtml-call "REQUEST.set(col[index1][index2], 5)">
> > Can you send me the traceback?
Thinking about it again makes me realize that it will not work, since set
just sets a variable, but does not take care of assignments. It is a little
bit hard to explain, maybe someone else can do a better job.
Here is what you would have to do:
<dtml-call "REQUEST.set('a', [[0, 0], [0, 0]])">
<dtml-call "REQUEST.set('a1', a)">
<dtml-call "a1.insert(0, 1)">
<dtml-call "a.insert(0, a1)">
This code is tested and works. But you will see that this is far too
complicated, thats why I would suggest you use a Python Method or an
Eternal Method to solve the issue.
CBU - Physics and Chemistry Student
Web2k - Web Design/Development & Technical Project Management