Stopping a running macro

Have a suggestion for improving DPlot or a question about existing features? Let us know

Moderator: DPlotAdmin

Post Reply
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Stopping a running macro

Post by jsc »

While I'm on the topic of not knowing what I am doing, could you add a way to stop a running macro? ESC and Ctrl-C don't seem to work.

Was just trying out a macro to standardize my colors on a file that had 4 curves with 200k points each. Each color command in the macro wanted to redraw the plot, which took 5-10 seconds each. My macro forced a redraw 16 times. Yes, I need to add the command to suspend redraws in the macro!
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Yes, I need to add the command to suspend redraws in the macro!
Yes, you do. :D

But that's a good suggestion. I'll add a check for pressing <Esc>.
Visualize Your Data
support@dplot.com
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

Yes, it's much better that way!
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I overlooked one obvious answer that you may not have been aware of: you can stop a running macro now by clicking the Stop button. That's assuming, of course, that you have the editor open rather than simply using "Run".

I've added a check for pressing the <Esc> key and it works, but not especially well unless you hold the key down rather than tap-tap-tap. Otherwise too many other messages get in the way and <Esc> won't be processed soon enough to do much good.
Visualize Your Data
support@dplot.com
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

Nope, I was running the macro from the File>Run command, so the editor was not open.

RE: Holding the Esc key - I think that would be acceptable and understood behavior. You would not want to slow down the macro facility just because the program stopped frequently to "listen" for the esc key.

Of course, I also think I'll remember to add PostponeRedraw() and ViewRedraw() to my macros from now on, too!
Post Reply