Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stopping a running program

544 views
Skip to first unread message

eric

unread,
Dec 29, 2008, 6:37:37 AM12/29/08
to
Hi! I just made the best program ever. It consists of

While[ 1==1,
Print["Hi"]
]

How do I stop this thing from running. Is there a CTRL-C in math.

Thanks!
I am using Mathematica 5.0

Jean-Marc Gulliet

unread,
Dec 30, 2008, 5:51:05 AM12/30/08
to
eric wrote:

You could try the Alt+. or Alt+, (Cmd+. and Cmd+, on Mac) or goto menu
Evaluation, then choose either Abort Evaluation or Interrupt Evaluation.

Regards,
-- Jean-Marc


Sjoerd C. de Vries

unread,
Dec 30, 2008, 5:51:16 AM12/30/08
to
Use alt-period. In Mathematica 7 it is the left alt. Other versions may use the
other alt. You can also use the Evaluation menu item: Abort
Evaluation.

Cheers -- Sjoerd

Jens-Peer Kuska

unread,
Dec 30, 2008, 5:52:29 AM12/30/08
to
Hi,

a) your While[ 1==1, Print["Hi"]] cause the kernel to send a lot of
data to the FrontEnd and the FrontEnd must format it again and
again for every new cell. So the FrontEnd is busy and it is
hard for it to send a Abort message to the Kernel.
I would suggest to use Dynamic[] to show the progress in a variable, i.e.,
mymessage = "Wait";
Dynamic[mymessage]

i = 0;
While[True,
mymessage = If[EvenQ[i++], "Humpty", "Dumpty"];
]

b) if you do so, Alt-"." as well as the menu entry
Evaluation | Abort Evaluation work

c) if not, you have to press Alt-. several times and
hope the the FrontEnd will get it and that the buffer
with all the Print[] messages is not too full

Regards
Jens

Steven Siew

unread,
Dec 30, 2008, 5:54:35 AM12/30/08
to
Read this PDF http://www.nhn.ou.edu/~morrison/Mathematica/TipSheets/GettingStarted.pdf under section 3.3 "Mathematica is taking too darn long to execute my
command. Can I abort this command without loosing all my work?"

Steven Siew

Steven Siew

unread,
Dec 30, 2008, 5:54:56 AM12/30/08
to
Do not forget your free Mathematica 5.2 keyboard shortcuts

http://media.wolfram.com/brochures/mathematicashortcuts.pdf

ABORT is ALT+.
INTERRUPT is ALT+,

For windows that is

Helen Read

unread,
Dec 31, 2008, 6:06:54 AM12/31/08
to
Jens-Peer Kuska wrote:
> Hi,
>
> a) your While[ 1==1, Print["Hi"]] cause the kernel to send a lot of
> data to the FrontEnd and the FrontEnd must format it again and
> again for every new cell. So the FrontEnd is busy and it is
> hard for it to send a Abort message to the Kernel.
> I would suggest to use Dynamic[] to show the progress in a variable, i.e.,
> mymessage = "Wait";
> Dynamic[mymessage]
>
> i = 0;
> While[True,
> mymessage = If[EvenQ[i++], "Humpty", "Dumpty"];
> ]
>
> b) if you do so, Alt-"." as well as the menu entry
> Evaluation | Abort Evaluation work
>
> c) if not, you have to press Alt-. several times and
> hope the the FrontEnd will get it and that the buffer
> with all the Print[] messages is not too full

Sometimes if the FrontEnd will not respond to Alt-. or Abort Evaluation,
you can shut down the kernel completely from Evaluation, Quit Kernel,
Local. Of course, that clears everything that you had in memory.

--
Helen Read
University of Vermont

Jens-Peer Kuska

unread,
Jan 1, 2009, 7:25:00 AM1/1/09
to
Hi,

that is a bit rude, what is with killing the Kernel, the FrontEnd
and reboot the computer ;-)

Regards
Jens

Helen Read

unread,
Jan 1, 2009, 8:29:57 PM1/1/09
to
Jens-Peer Kuska wrote:

> Helen Read wrote:
>>
>> Sometimes if the FrontEnd will not respond to Alt-. or Abort Evaluation,
>> you can shut down the kernel completely from Evaluation, Quit Kernel,
>> Local. Of course, that clears everything that you had in memory.
>
> that is a bit rude, what is with killing the Kernel, the FrontEnd
> and reboot the computer ;-)

I like to show my students early in the year how to crash Mathematica,
as a way of encouraging them to save their file while they work :-).

0 new messages