Hi all,
using recent git version on Ubuntu, the following script leads to a crash of Gretl:
set verbose off
function void multiplot_single_var (const list L)
strings Plots
gpbuild Plots
loop foreach i L
plot L.$i
options with-lines time-series
endplot
endloop
end gpbuild
# gridplot Plots --width=1100 --height=700 --fontsize=11 --output="@filename"
end function
open denmark -q
list L = dataset
multiplot_single_var(L)
Reason is the wrong command endplot instead of end plot.
Best
Artur
Please supply a trace for the crash using gdb or (preferably) valgrind. I can't produce a crash here (tried on Linux and Mac) though I do of course get an error.
The error condition arises because "endplot" does not end "plot", so "endloop" is encountered when still inside a plot block. Note that gretl doesn't actually try to execute the invalid "endplot" statement, since it's in "compile a loop" mode at the time.
Thanks Jack and Luca. I'll attempt to explain what's going on before long. Meanwhile this should be fixed in git.
Thank you for fixing that, Allin. It works now in the sense that an error is thrown and gretl does not crash.
I am going to close the ticket.