7 Mar
2001
7 Mar
'01
3:15 p.m.
Axel Missbach wrote:
Hello, please tell me how access an list member in a dtml-Method/ Document.
per Example, having a list numbers[7,11,13,17,19]. How to get the first item?
<dtml-var numbers[0]> results in a KeyError! Why?
greetings Axel
<dtml-var numbers[0]> is equivilant to <dtml-var name="numbers[0]">. What you are writing is a (short) expression. Try: <dtml-var expr="numbers[0]"> You have stumbled upon the reason why the shorthand notation: <dtml-var x> and <dtml-var "x"> is discouraged in favor of <dtml-var name="x"> and <dtml-var expr="x"> respectively. They may be longer, but they are much more explicit. -- | Casey Duncan | Kaivo, Inc. | cduncan@kaivo.com `------------------>