Shouldn't the iterator class support iterator.self()? All I seem to get to work is iterator.next(), which is unsuitable for my needs (of creating a running sum)... Two iterators won't work either, or even calling .next() twice to get every second row - any idea of what I might be doing wrong?
Thanks,
E.
Hi E.,
the iterator (in the example script in the node) is an iterator over DataRows from the input DataTable, so it supports the java-methods hasNext() and next().
You can call the next() method twice to get every second row and you can have two iterators, I haven't encountered any problems with that. Maybe you can send me an example script so I can see what is going wrong.
nicolas.cebron(at)uni-konstanz.de
I don't know what the iterator.self() method is, I suppose it's something python-specific, maybe you can explain what you want to achieve with this method.
- Nicolas
For what I understood (or hoped to understand) from Python docs I found, iterator.self() would give a pointer to the current element, as opposed to the next one... but probably I was mistaken. Anyway, Python != Jython, and even within Jython one has to be careful about the version, that's what I know for sure now.
About calling .next() twice - I was just about to explain you when I saw where my thinking was failing. It's solved now, I'll eventually post a Jython runing sum snippet if you wish. :-)
Regards,
E.
P.S.: Is adding extra output colums scriptable somehow? Having to do it in the dialog makes for rather unflexible scripts... A flexibility prerequsite would be being able to iterate across columns, too - is that possible?