I think there's something wrong with the "catch" function. The problem occurs inside a function and inside a loop. Please take a look at the attached script and functions (AutoARIMA and Backtest).
When I use a "catch" in the line 96 of the "Catch & Function potential problem.inp", Gretl stops responding and crashes. Also, when I don't use it in the command the second loop inside "Catch & Function potential problem.inp" (the loop starts in line 83) generates an error.
Furthermore, the "flush" command is not working in this context.
I really don't know if it is a problem of Gretl or a problem of mine :-(