Am 05.01.2018 um 14:07 schrieb Schaff, Frederik:
list seems to pass the names of the series, but does not work. If I
remove the function body, everything works.
Yes, see the "Foreach loop" section in the loop chapter 12 of the manual:
"Note that if you use this idiom inside a function (see chapter 13),
looping across a list that has been supplied to the function as an
argument, it is necessary to use the syntax listname.$i
to reference the list-member variables."
(Of course, $i must be replaced with what the loop index is in your case.)
function matrix MatOrderDist (list ls, list lsB[null])
if exists(lsB)
Hey, we had this before, don't use exists() with list function args. It
will always return 1, even for null. Use nelem() directly (with lists
only!).
loop foreach item ls -q
to_plot[r,1] = min($item)
OK, this would need to be ls.$item instead.
loop foreach item lsB -q
to_plot[r+offset*(r-1),1] = min($item)
And this: lsB.$item.
hth,
sven