On Tue, 9 Aug 2011, amaryl wrote:
On Mon, 2011-08-08 at 22:04 -0400, Allin Cottrell wrote:
> On Tue, 2 Aug 2011, Summers, Peter wrote:
>
>>> Sometimes a tool to forcibly terminate a running script would come very
>> handy, too. Maybe a combined "Start/Stop" button or something alike.
>>
>> I found myself looking for the "stop" button just yesterday ;-).
>
>> From a programmer's point of view, the question is: where should we
> stick the handlers for aborting a script? Is everyone who's putting
> forward this idea thinking in terms of breaking out of a gretl loop?
>
> Notice that you have a "break" command for loops, so with some
> foresight you can arrange a conditional breakout if things are not
> going well.
Personally, I am not thinking of breaking out of faulty loops.
In one of my scripts I had a lot of time-consuming loops. When I wanted
to check changes in my script not directly related to the loops, I
usually commented them out, but occasionally I forgot. A stop-button
would have been useful. "break" obviously doesn't help me in that case.
In general, I think a stop-button is useful in cases where you notice
that you have lacked foresight ;-)
The problem with a "break" button is that the program has to constantly
check if the button has been pressed and, if so, take the appropriate
action. This slows down execution and I personally don't like it very
much. This said, it has happened to me to long for a break button, like
for example when you run some estimation command that is known to take
minutes and you realise just after having pressed "OK" that you forgot to
add a variable or so.
What we may want to do is think about some mechanism for interrupting the
current command in the GUI client, and advise users to use the unstoppable
might of the CLI client if performance is of paramount importance.
Thoughts?
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti