Oh yes, thanks! I tried to wrap it in a function, like
----
function list NonConstList(list Input)
/* Make constants non constant in temp list */
list outlist = null
loop foreach i Input --quiet
if var($i) > 1e-20 # some arbitrary small number
outlist += $i
else var($i) < 1e-20
series new$i = $i + uniform() * 1e-10
outlist += new$i
endif
endloop
return outlist
end function
----<
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
Error executing script: halting
if var(Routine_Price_min) > 1e-20
list temp = NonConstList(RoutineP8)
-----<
I guess the problem is that the list is not passed "by reference"? I tried to
pass *Input, but thats not working, too. Is there a way to process "global"
variables (like the list "Input")?`
But really, that is not too important. I can go with copy and paste and this is already
more than what I'd hoped for.
-Frederik
-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu [mailto:gretl-users-bounces@lists.wfu.edu] Im
Auftrag von Sven Schreiber
Gesendet: Samstag, 31. Oktober 2015 12:30
An: gretl-users(a)lists.wfu.edu
Betreff: Re: [Gretl-users] Boxplot, automation, constant, work-around?
Am 31.10.2015 um 12:24 schrieb Schaff, Frederik:
list outlist = null
loop foreach i inlist --quiet
if var($i) > 1e-20 # some arbitrary small number
outlist += $i
elif var($i) < 1e-20
to be on the safe side, you should use "else" here or "<=". In
principle a series with var($i) == 1e-20 isn't included in your code. (Although of
course the probability of having exactly 1e-20 is basically zero.)
-s
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users