Am 31.10.2015 um 12:38 schrieb Schaff, Frederik:
Oh yes, thanks! I tried to wrap it in a function, like
----<
but I am getting an error:
> -----
The symbol 'Routine_Price_min' is undefined
error evaluating 'if'
*** error in function NonConstList, line 10
> if var($i) > 1e-20
This is expected, see section 13.4 of the guide:
Please note: a special piece of syntax is needed in this context. If we
wanted to perform the
above task on a list in a regular script (not inside a function), we
could do
loop foreach i X
scalar sd_$i = sd($i)
endloop
where $i gets the name of the variable at position i in the list, and
sd($i) gets its standard
deviation. But inside a function, working on a list supplied as an
argument, if we want to
reference an individual variable in the list we must use the syntax
listname.varname. Hence in
the example above we write sd(X.$i).
-s